Control Flow

If_else determines the logic flow of the program
  • The structure of the if-else statement has the form:

if (condition1 is true):
  do A
elif (condition2 is true):
  do B
else:
  do C
  • example 1: grading test scores

  • example 2: palindrome

Last updated

Was this helpful?