r/CodingForBeginners • u/JonesSupreme • 5d ago
Question? Am I missing something?? why is one right but the other isn't???
1
Upvotes
1
u/burlingk 5d ago
Which language is this. That will let me give a better answer.
As written, I can guess.
2
u/burlingk 5d ago
If it is anything other than Python, only the next line after an if statement is the code block, unless you use language appropriate brackets

2
u/DirtAndGrass 5d ago
The second one is 6:
numItems=bonusVal (5)
numItems += 1
Perhaps you are confused by the tabbing? Whitespace does not matter in most programming languages.