Computer >> Computer tutorials >  >> Programming >> Python

What are multiple statement groups as suites in python?


A group of individual statements, which make a single code block are called suites in Python. Compound or complex statements, such as if, while, def, and class require a header line and a suite.

Header lines begin the statement (with the keyword) and terminate with a colon (: ) and are followed by one or more lines which make up the suite. 

example

if expr1==True:
  stmt1
  stmt2
elif expr2==True:
  stmt3
  stmt4
else:
  stmt5
  stmt6
while expr==True:
  stmt1
  stmt2