[vc_row css_animation=”” row_type=”row” use_row_as_full_screen_section=”no” type=”full_width” angled_section=”no” text_align=”left” background_image_as_pattern=”without_pattern”][vc_column][vc_column_text]

If statements in Python – Summary

[/vc_column_text][vc_separator type=”normal” up=”1″][vc_column_text css=”.vc_custom_1571502417786{background-color: #f6f6f6 !important;}”]

Summary of the chapter “If statements in Python”. In this chapter we have looked at the basics of conditional statements that allow you to decide what will happen in the program depending on the state of a Boolean expression (True or False). We do this with the if, elif and else statements.

[/vc_column_text][vc_empty_space height=”20px”][vc_column_text]

THE CONDITION IS EITHER TRUE OR FALSE

The conditional statements are evaluated by conditions. The terms can have two states, true, or false. If the condition is true, the condition statement will be executed, or if the condition statement is false, then the condition statement will not be executed.[/vc_column_text][vc_empty_space height=”30px”][vc_column_text]

IF, ELSE AND ELSE IF

A condition statement in Python always starts with an if condition. If the if condition is true, then all the operation belonging to the if statement will be performed. However, the if condition is false, the program skips all operations in the if statement and proceeds to the else if statements accordingly. If none of the if or else if statements are fulfilled, then the operations in the else statement will be performed.[/vc_column_text][vc_empty_space height=”30px”][vc_column_text]

THE CONDITION STATEMENTS CONTROL OUR PROGRAMS

With the help of if-statements we can:

  • Control all programming with logic.
  • Control terms with Boolean expressions (true or false)
  • Decide the operations to perform or not

[/vc_column_text][vc_empty_space height=”30px”][vc_column_text]

[/vc_column_text][vc_empty_space height=”20px”][vc_separator type=”normal”][vc_empty_space height=”20px”][/vc_column][/vc_row][vc_row css_animation=”” row_type=”row” use_row_as_full_screen_section=”no” type=”full_width” angled_section=”no” text_align=”left” background_image_as_pattern=”without_pattern”][vc_column][vc_column_text]

Previous Page    |    Next Page

[/vc_column_text][vc_empty_space][/vc_column][/vc_row]