0
I’m trying to make a program in which I can type a number n and then I would like to generate a random number between 1 and 2. If that random number is the same as n, would show "You won!" and otherwise, "You lost". However, even when you hit the number, it is showing "You lost!".
Follow my code. Thank you.
from random import randint
n = (input('Digite um número: '))
print (randint( 1, 2))
if n == (randint):
print ('Você ganhou!')
else:
print ('Você perdeu!')