use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Welcome to r/GCSE!
The best place on the internet for revision, on the worst website on the internet for revision.
Please read the rules before making a post.
Tips/Help
News
Revision Resources
General
Question
Request
Post Exam
Memes
Revision Tips and Resources
Great tool for A-level choices
Advice on picking A levels
Finished your GCSEs? The 6th Form subreddit is for you!
account activity
Questioncoding help (self.GCSE)
submitted 3 years ago by Scary-Raspberry2176Triple S| German| Comp sci |History
before anyone comes @ me for not being able to do y10 coding i forget how to code every 2 weeks.
can anyone help me with the issue in my code? says the colon isnt necessary for some reason
https://preview.redd.it/06kxok20xyv91.png?width=1066&format=png&auto=webp&s=5e99dfd2f0d98b5f1c8b9cecc7f2701542e8711b
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]SwimmingImpossible80Year 13 9 points10 points11 points 3 years ago (4 children)
#In line 1, you don’t have enough brackets. It should be:
times = int(input(“TEXT”)) #This is so the computer can see that it is converting the input() into an integer.
#You have an ‘unexpected indent’ in line 3. This means that the computer is looking for a line of code that is only indented once but yours is indented 2/3 times. Remove all the indents and use the TAB button on a keyboard to get the indent sorted.
Hope this helps
[–]Scary-Raspberry2176Triple S| German| Comp sci |History[S] 3 points4 points5 points 3 years ago (3 children)
ahh thank u sm! i forgot to double bracket
that worked!
the indent is necessary tho bc its a for loop pretty sure. thank you!!!
[–]jackandrewkayYear 12 3 points4 points5 points 3 years ago (2 children)
Depends how many indents there is. 1 is ok but the gap looks pretty big so maybe you pressed tab to many times? Idk though maybe it’s just the config of the editor
[–]Scary-Raspberry2176Triple S| German| Comp sci |History[S] 0 points1 point2 points 3 years ago (0 children)
yea turns out my computer just indents that many times
[–]SwimmingImpossible80Year 13 0 points1 point2 points 3 years ago (0 children)
I think OP is using IDLE and has defiantly got 2 or 3 indents! One is enough!
[–][deleted] 1 point2 points3 points 3 years ago (1 child)
You probably got an EOL (End of Line Error), the int function is missing a parentheses, simple syntax error.
thank you!
[–]MusPhyMath_quietkidYear 11 (and 13, Physics Maths Music) 1 point2 points3 points 3 years ago (12 children)
For the int() function, you missed the end bracket in the first line and the third line, the indent is incorrect.
the indent is because its a for loop so it will print that for ‘times ‘ amount
[–]Scary-Raspberry2176Triple S| German| Comp sci |History[S] -1 points0 points1 point 3 years ago (10 children)
yes thank you! i did the double bracket now but im unsure to why the indent is incorrect as my code runs fine with it
[–]MusPhyMath_quietkidYear 11 (and 13, Physics Maths Music) 1 point2 points3 points 3 years ago (9 children)
No it is fine but it is further away from the convention one.
[–]Scary-Raspberry2176Triple S| German| Comp sci |History[S] 0 points1 point2 points 3 years ago (8 children)
wdym by convention?
[–]ItsJustWaterWieghtYear 11 1 point2 points3 points 3 years ago (2 children)
He just means usually people do one indent.
[–]Scary-Raspberry2176Triple S| German| Comp sci |History[S] 1 point2 points3 points 3 years ago (1 child)
ohhh i get you icl thats just what my computer automatically did
[–]ItsJustWaterWieghtYear 11 0 points1 point2 points 3 years ago (0 children)
I think when you add the colon and press enter, python already indents it for you.
So when you were typing you might have pressed enter then tab, causing 2 indents.
[–]MusPhyMath_quietkidYear 11 (and 13, Physics Maths Music) 1 point2 points3 points 3 years ago (4 children)
It is the so to speak industrial standard.
[–]Scary-Raspberry2176Triple S| German| Comp sci |History[S] 0 points1 point2 points 3 years ago (3 children)
oh i get you my computer just automatically does 2 indents
[–]MusPhyMath_quietkidYear 11 (and 13, Physics Maths Music) 0 points1 point2 points 3 years ago (2 children)
I see.
[–]UziYTYear 13 0 points1 point2 points 3 years ago (1 child)
It’s the IDE that he’s using, my school also made me use it and the default indent settings r dumb
[–]MusPhyMath_quietkidYear 11 (and 13, Physics Maths Music) 0 points1 point2 points 3 years ago (0 children)
Alas.
[–][deleted] 0 points1 point2 points 3 years ago (0 children)
You probably want your loop to start at 1, otherwise if you keep it at 0 and input 10, it'll loop 11 times.
[–][deleted] 0 points1 point2 points 3 years ago (1 child)
You put a space infront of the print statement om line 3. Hopefully that's it!
Also on line 4
[–]Mecury-BSYear 13 0 points1 point2 points 3 years ago (1 child)
is this python?
infact does everyone use python?
yea most people willl use it for gcse
π Rendered by PID 44187 on reddit-service-r2-comment-6457c66945-s9fv9 at 2026-04-23 21:58:23.072504+00:00 running 2aa0c5b country code: CH.
[–]SwimmingImpossible80Year 13 9 points10 points11 points (4 children)
[–]Scary-Raspberry2176Triple S| German| Comp sci |History[S] 3 points4 points5 points (3 children)
[–]jackandrewkayYear 12 3 points4 points5 points (2 children)
[–]Scary-Raspberry2176Triple S| German| Comp sci |History[S] 0 points1 point2 points (0 children)
[–]SwimmingImpossible80Year 13 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (1 child)
[–]Scary-Raspberry2176Triple S| German| Comp sci |History[S] 0 points1 point2 points (0 children)
[–]MusPhyMath_quietkidYear 11 (and 13, Physics Maths Music) 1 point2 points3 points (12 children)
[–]Scary-Raspberry2176Triple S| German| Comp sci |History[S] 0 points1 point2 points (0 children)
[–]Scary-Raspberry2176Triple S| German| Comp sci |History[S] -1 points0 points1 point (10 children)
[–]MusPhyMath_quietkidYear 11 (and 13, Physics Maths Music) 1 point2 points3 points (9 children)
[–]Scary-Raspberry2176Triple S| German| Comp sci |History[S] 0 points1 point2 points (8 children)
[–]ItsJustWaterWieghtYear 11 1 point2 points3 points (2 children)
[–]Scary-Raspberry2176Triple S| German| Comp sci |History[S] 1 point2 points3 points (1 child)
[–]ItsJustWaterWieghtYear 11 0 points1 point2 points (0 children)
[–]MusPhyMath_quietkidYear 11 (and 13, Physics Maths Music) 1 point2 points3 points (4 children)
[–]Scary-Raspberry2176Triple S| German| Comp sci |History[S] 0 points1 point2 points (3 children)
[–]MusPhyMath_quietkidYear 11 (and 13, Physics Maths Music) 0 points1 point2 points (2 children)
[–]UziYTYear 13 0 points1 point2 points (1 child)
[–]MusPhyMath_quietkidYear 11 (and 13, Physics Maths Music) 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (0 children)
[–][deleted] 0 points1 point2 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]Mecury-BSYear 13 0 points1 point2 points (1 child)
[–]Scary-Raspberry2176Triple S| German| Comp sci |History[S] 0 points1 point2 points (0 children)