Jun-22-2021, 09:21 PM
Hello, i have been trying to make a guess the number game as a beginner project. I am very new to coding and wrote the following code:
Please help me.
import random import sys a = (random.randint(1,10)) #print (a) c = 3 while c > 0: b = int(input("Guess a number from 1 to 10:" )) #print (b) if a == b: print("You guessed the right Number!") c = 0 else: if c == 1: print("You guessed the wrong Number and you have run out of guesses!") else: print("You guessed the wrong Number") c = c - 1 #print (c) d = int(input("Type 1 to continue:" ) if d == 1: #print(d)But when I wanted to add a restart option to my project but it didn't work. It says that there is a syntax error.
Please help me.