If 10 < 5: Why the colon? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

If 10 < 5: Why the colon?

4th Mar 2017, 9:10 PM
Wenwin
2 Answers
+ 3
It is part of the python syntax. It tells the interpreter where the end of the condition is and to expect an indentation of code for the if statement. Without it, the code would produce an error.
4th Mar 2017, 9:14 PM
ChaoticDawg
ChaoticDawg - avatar
0
Thank you, your reply is very clear and helpful.
4th Mar 2017, 11:25 PM
Wenwin