1
`import random
print("Try to guess the number!")
print()
difficulty = input("Select your difficulty: Easy, Medium, Hard, or Insane:\n").lower #Selecting 
your difficulty(how hard the game is)
if difficulty == 'easy':
    number = random.randrange(1, 100) #Picks a number between 1 to 100 and assigns it to number
    if number > 50:
        print("*HINT*: \n The mystery number is greater than 50")
        if number > 75:
            print("*HINT#2*:\n The mystery number is greater than 75")
        else:
            print("*HINT#2:\n The mystery number is less than 75")
    if number < 50:
        print("*HINT*: \n The mystery number is less than 50")
        if number < 25:
            print("*HINT#2*\n: The mystery number is less than 25")
        else:
            print("*HINT#2:\n The mystery number is greater than 25")  `

For some reason it just exits the code even if the number is less or greater than 50. I am struggling with this please help.

Ayo
  • 11
  • 4
  • When you stepped through the program was any point in the execution suspect? [How to debug small programs](https://ericlippert.com/2014/03/05/how-to-debug-small-programs/). If you are using an IDE **now** is a good time to learn its debugging features. Printing *stuff* at strategic points in your program can help you trace what is or isn't happening. [What is a debugger and how can it help me diagnose problems?](https://stackoverflow.com/questions/25385173/what-is-a-debugger-and-how-can-it-help-me-diagnose-problems) – wwii Apr 08 '21 at 18:13

1 Answers1

1

You forgot to add the () to .lower

difficulty = input("Select your difficulty: Easy, Medium, Hard, or Insane:\n").lower() #Selecting 
your difficulty(how hard the game is)
Martí
  • 571
  • 6
  • 17