How to use if OR Statements in Python

Python if OR statements provide the same logic as multiple if-else statements but with the ability to execute the same block of code if one of the statements is True.


To create an OR statement in Python, place or between two different evaluations.


To demonstrate this, let's check if the current day is not the weekend using an OR statement and execute some code if True.


today = 'Thursday'

if today == 'Saturday' or today == 'Sunday':
   print(f'Today ({today}) is the weekend!')
   print(f'Today ({today}) is a work day!')
Today (Thursday) is a work day!

Related Tutorials


Python Assert Statement

September 30, 2020

How to Use For Loops in Python

September 02, 2020