from fileinput import close
from random import Random, random
print('Do you want to play a game?')
input1 = input("yes or no? ")
if input1 == "yes" or input1 == "Yes":
print("You have 3 tries to guess a random integer between 0-10. If you guess right
you win. If not I do. Ready?")
import random
def repeat():
number = random.randint(1,10)
print(number)
guess1 = input('Your first guess: ')
if guess1 == number:
print('You are correct! You only needed one try!')
else:
print('Wrong two tries left!')
guess2 = input('Your second guess: ')
if guess2 == number:
print('You are correct! You needed two tries!')
else:
print('Wrong one try left!')
guess3 = input('Your third and last guess: ')
if guess3 == number:
print('You are correct! It took you all three tries!')
else:
print('You are wrong! You lost! The number was:')
print(number)
input2 = input('Do you want to play again? Yes or No? ')
if input2 == 'Yes' or 'yes':
repeat()
else:
close()
else: close() repeat()
I have no clue where the mistake is, but when I guess number correctly it still says its wrong.