0

I don't know why my input won't pass through my if statement properly. It just starts the first if statement every time no matter what is typed into the input.

def ask_for_difficulty(self):
    print("Beginner: 6 x 6 (B) - Intermediate: 9 x 9 (I) - Expert: 12 x 12 (E) \n")

input_difficulty = input("Choose a difficulty: Beginner: B or 1 - Intermediate: I or 2 - Expert E or 3 \n\nChoice: ").lower()

if input_difficulty == 'beginner' or '1' or 'b':
  self.dim_size = 6
  self.bomb_amount = 6
  print('\nGood Luck! \n')
  Minesweeper.play_game(self)

elif input_difficulty == 'intermediate' or '2' or 'i':
  self.dim_size = 9
  self.bomb_amount = 15
  print('\nGood Luck! \n')
  Minesweeper.play_game(self)

elif input_difficulty == 'expert' or '3' or 'e':
  self.dim_size = 12
  self.bomb_amount = 30
  print('\nGood Luck! \n')
  Minesweeper.play_game(self)

else:
  print("")
  print("That is not a valid choice, try again.")
  Minesweeper.ask_for_difficulty(self)
Remy
  • 1

0 Answers0