The PC uses randint to generate a random number between 1 and 10. When i enter a number i want it to be able to tell if it has the same number as me, so i have written this which was working but when i re-ran it, the program stopped working when the numbers were the same and said that i had still won. (you win if you don't have the same number as the PC)
CODE:
print('Your number is: ', player)
answer = input('Confirm? (y/n)')
if answer == ('y') :
print('You have selected ', answer)
print('Game begining in: ')
print('3')
time.sleep(1)
print('2')
time.sleep(1)
print('1')
time.sleep(1)
pc = (randint(1,10))
print('Your number is: ', player, 'and the PC number is:', pc)
if pc == player :
print('You lose! Suck din')
elif pc != player :
print('You Win!')
elif answer == ("n") :
loop =