Oct-03-2021, 10:07 AM
(This post was last modified: Oct-03-2021, 10:29 AM by Yoriz.
Edit Reason: Added code tags
)
Hi, I am quite new to python as I just started doing the GCSE so please don't leave any rude comments- I have probably made many mistakes.
One of my homework questions was to create a program which repeatedly asks the user for a number until they enter a 10.
This is the code I wrote:
Could someone more experienced please tell me what went wrong? Thank u!!
ps there was probably a better way to paste the code- sorry I'm new
One of my homework questions was to create a program which repeatedly asks the user for a number until they enter a 10.
This is the code I wrote:
#Asks for a number repeatedly until you enter 10 Number= int(input("Enter a 10")) if number== 10 : print("You have entered a 10") elif Number < 10 #Number less than 10 print("Please enter a 10") input()It came out with this
Error: File "main.py", line 5
else Number < 10
^
SyntaxError: invalid syntax
Could someone more experienced please tell me what went wrong? Thank u!!
ps there was probably a better way to paste the code- sorry I'm new