mercredi 17 mars 2021

Input selection in Python using IF statements [duplicate]

Im trying to create code that prints a game's difficulty level based on what the "diffChoice" value is using IF statements. However, I can't get the "gameDiff" value to correctly represent what the "diffChoice" was. Any help/feedback is appreciated.

diffChoice = 'm'

if diffChoice == 'e' or '1':
    gameDiff = 'EASY'
if diffChoice == 'm' or '2':
    gameDiff = 'MEDIUM'
if diffChoice == 'h' or '3':
    gameDiff = 'HARD'

print(gameDiff)

Aucun commentaire:

Enregistrer un commentaire