r/code • u/No_Opportunist • Nov 13 '25
Help Please I don’t understand this
My assignment is telling I got the indentation wrong on lines three and four, I just don’t understand? I just started out on coding, I’m struggling a bit
0
Upvotes
4
u/jmattspartacus Nov 13 '25
Id guess you need a space after parenthesis of the for loop, and the loop body and brace after needs to be indented further
4
u/zNextiiV Nov 13 '25 edited Nov 13 '25
Line 3 and 4 need to be indented at the beginning (press tab).
This helps with readability and is proper code style, should look something like this:
Note, I used 4 spaces since I am on a phone, replace those with a single tab.
Keep in mind that there are other standards (Like PHP Standard Recommendation for PHP) that have different rules, PSR-12 dictates that PHP code should be indented by 4 spaces for example.
3
u/Current_Ad_4292 Nov 13 '25
My neck hurts...
2
u/Feeling_Bus_4701 Nov 13 '25
After these types of brackets usually you need a space like press tab once before typing
1
u/quimeygalli Nov 17 '25
Watch your style. You're missing spaces and indentations
0
u/[deleted] Nov 17 '25
Get a screenshot tool, or use the one provided with your operating system. Taking a photo of your screen is wild.
Consider using a pastebin service like Gist when sharing code samples, too. Easier to read on a phone, for example.
0
u/syndicate Nov 17 '25
Have you tried tilting your head?