+ 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