I'm working on improving my python 3 skills by creating this simple game.
Very basic, you have a random number between 1 and 5 and if you guess it correct them you win. However for reason reason whenever I try to run it all I get is the "you lose" result even when my test print shows I got the same number.
#!/usr/bin/python3
import random
B = input("Pick a number between 1 and 5:" )
F = random.randrange(1, 5, 1)
if B == F:
print("You win")
else:
print("You lose")
print (B, F)
I can't tell if it's the ==
function that is causing the problem or the if
function is wrong for some reason but it doesn't look it.