How do I repeat function until the city and country of the IP address isn’t recognized as ‘Unknown’?
I’m making a Python program where it gives you a link where you have the option to generate between 5-10 IP address and its city and country it’s in. But sometimes, the IP address is recognized as ‘Unknown’. I tried to put it in a try/except block so that when it’s ‘Unknown’, it will regenerate but sometimes, it will create an IP address that’s also recognized as ‘Unknown’. I tried to fix it by using a while loop so that it can repeat the line until it is valid but I don’t know how to check for it in the while loop. How do I fix this problem?