CODE COACH: MATCHING PASSWORDS (Python Core 33.2)
In Code Coach 33.2 in Python Core, we are presented with an exercice to make a lowly password checker. This is the (working) solution I found: password = input() repeat = input() def validate(text1, text2): #your code goes here if text1 == text2: print("Correct") else: print("Wrong") validate(password, repeat) My initial solution, which didn't work, wasn't much different, but included "" around text1 and text2 when checking their values. password = input() repeat = input() def validate(text1, text2): #your code goes here if "text1" == "text2": print("Correct") else: print("Wrong") validate(password, repeat) In this case, it worked for alphanumeric strings, such as "John874" but didn't for purely numeric strings, such as "14386562". I thought it was odd, considering "password" and "repeat", being "input()" without an "int()" should be treated as strings even in the case they were indeed numbers. That's okay, I thought... [1/2]