how to use the dot lower function 1

how to use the dot lower function

Dif_Level = input("What is your level of difficulty? Hard, Medium or Easy")
if Dif_Level.lower() == 'hard':

elif Dif_Level.lower() == 'medium':

elif Dif_Level.lower() == 'easy':

Here is what the above code is Doing:
1. It’s asking the user to input a difficulty level.
2. It’s checking if the user input is equal to ‘hard’.
3. If it is, it’s going to print out the following:
“You have chosen the hard level. You will have to guess a number between 1 and 50. You will have 10 guesses.”
4. If the user input is not equal to ‘hard’, it’s going to check if the user input is equal to ‘medium’.
5. If it is, it’s going to print out the following:
“You have chosen the medium level. You will have to guess a number between 1 and 25. You will have 5 guesses.”
6. If the user input is not equal to ‘medium’, it’s going to check if the user input is equal to ‘easy’.
7. If it is, it’s going to print out the following:
“You have chosen the easy level. You will have to guess a number between 1 and 10. You will have 3 guesses.”
8. If the user input is not equal to ‘easy’, it’s going to print out the following:
“You have not chosen a valid difficulty level. Please choose a valid difficulty level.”

Similar Posts