I'm trying to learn python with learning by doing way, but i have a problem with my code. Trying to do a code, where you input IP and code will check, if IP is in the ips.txt file, but when i add for example "192.168.0.10" and in file already is "192.168.0.100" then it will show, that "192.168.0.10" is in txt file, because "10" is part of the "100" number.
The same example is "dog" and "dogs", "dog" is basically inside "dogs", so it will tell that dog is in file...
Can you help me with it? Thanks
IPs = IPs.read()
IP = input("Check IP: ")
if IP in IPs:
print("IP is in the list.")
else:
print("IP is not in the list.") ```