In Python: What are the requirements for the commands?

Asked 2 years ago, Updated 2 years ago, 15 views

What is the rule of the command that Python requires :
After If, After While, After Else,
I understand it somehow, but I don't feel refreshed.

python

2022-09-30 18:02

1 Answers

If a colon is required at the end of a line, a compound statement (control statement) is applicable.
http://docs.python.jp/3/reference/compound_stmts.html
Indent from the next line to indicate that a block begins.

Here you go too:
http://docs.python.jp/3/faq/design.html#why-are-colons-required-for-the-if-while-def-class-statements


2022-09-30 18:02

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.