I need to check if a character entered in a password contains an integer or not.
password = input("Enter a password:" )
for num in password:
if num.isdigit():
break
else:
print("Your password must contain a number.")
The code above doesn't work because I'm assuming due to python 3 taking every user input as a string, it checks the string and never knows the difference between the string and the integer in the string. How would I get around this?