This question already has an answer here:
- How can I read inputs as integers? 14 answers
I am trying to make this simple game in python but whatever I write inside if statement just gets ignored.
import random
b=input("Select your difficulty (1,2,3) ")
if b==1:
print ("you selected easy.")
c=input("Enter a number ")
d=random.randint(0,1)
if c==d:
print("Congratulations! You win.")
if c!=d:
print ("You lose")
Aucun commentaire:
Enregistrer un commentaire