0
val = input("how many players") if val == 1: print("you are going to bat") else: print("choose ur field")
The above question is the one which i have tried when i give the val value as 1 its displaying the else part choose ur field but actually i have to get the if part but not getting may i know the reason plz guys help me to solve this....
1 Réponse
+ 3
try
val = int(input(.....))
or,
val = input(....)
if val == "1":
....
........
because input() takes only strings and you can't just compare strings with integers.