0
Why is it that logical operators don't work with user input?
For example: >>> a = input() False >>> q = not a >>> print(q) False >>> print(not False) True
2 Respostas
0
not sure, but I think a string when checked for true/false is equal to true if it contains characters
0
Because the user input is a string type and not a logical type.
Reread the beginning of the Python course about setting variable values and then use conditional statements like if to set variables of a logical type to match the user input value.