+ 1
Range function
range = list(range(-100,10000,77)) guess = input() if guess in range: print("Win") else: print("Loss") # why does this boolean always return False? (“loss”)
2 Réponses
+ 11
guess = int(input())
+ 2
It looks like you set a variable to the same name as a function, this can confuse the interpreter as it is not sure which you mean. Also you can just use
if guess in range(-100,10000,77)):
Anna is also right since your input is a string you need to specify it as an int