How to compare multiple choices in Python if statement? In an if else statement, if case sensitivity is a concern on the response or input from the user. Then the expected response should be defined on the if statement. Of course, there’s a good workaround on this kind of scenario like converting all input to lowercase or uppercase then start comparing or matching. Basically, the code below is for illustration purposes only. Converting the input to lowercase or uppercase is a good option, if the program is expecting a string input. However, code illustrated below will not be useful if the input is a number. In which case, converting the input to lowercase or uppercase will not help. Anyway, code below uses the string T, True or true as possible input that will display this message” You must have seen the sun! Or hoping to see the sun at the end of the tunnel!” if it matches “T, True or true”. If the input is TRUE, or other letter other than the characters mentioned above it...
Make the world a better place by sharing knowledge, ideas and anything that you can give that comes from the heart.