clubs:python_club:python_club_conditional_statements
Home | clubs :: cloud club :: python_club :: 3D-Printing | projects :: Proxmox | Kubernetes | scripting | utilities | games
Table of Contents
Python Club Topics - Conditional statements
Conditional statements
- Determine 1 of multiple paths or which set of code to run depending on the evaluation of a condition
- if
- if/else
- if/elif/else
if example
a = 100 b = 200 if b > a: print("b is greater than a")
if/else example
a = 300 b = 200 if b > a: print("b is greater than a") else: print("a is greater than b")
if/elif/else example
a = 200 b = 200 if b > a: print("b is greater than a") elif a == b: print("a and b are both equal") else: print("a is greater than b")
clubs/python_club/python_club_conditional_statements.txt · Last modified: by 127.0.0.1
