May-18-2021, 06:29 PM
You ask for an integer in the prompt, but "input" returns a string. It doesn't matter what the user types. If they type "1" or "one" the return type is a string.
while True: number = input('Enter number ') if not number: break print(number, type(number), number==1)Regardless of what you type, a string is never equal to an integer.
Output:C:\Users\...>python junk.py
Enter number one
one <class 'str'> False
Enter number 1
1 <class 'str'> False
Enter number
When I type 1, this is input as the string '1'. The string '1' is not equal to the int 1. If your dataframe contains numbers for Customer Key, you will have to convert the input from a string to an integer (use int(str)). But you should first verify that Customer Key really contains ints and not strings.