+ 2
Confused with while/if line
So iâm writing a line of code: if (name == 'Joshua' and age == 18): i = 1 while i <= 5: print(i) i = i + 1 if i == 5 print("Finished") Yes this is taken from a lesson with me adding onto it; When I attempt to run the code, it says thereâs a syntax error at âif i == 5â Why is it not letting me only print âfinishedâ if i == 5? Am I misunderstanding something? Thanks
2 Answers
+ 3
Answer, I simply forgot the colon I realized after attempting to solve this for 20 minutes right after posting this question. Sorry