xFactorSchool.com(Beta)
How to Do Examples
Python Examples
HTML Examples
Code Examples
C Code Examples
C++ Code Examples
C# Code Examples
Java Code Examples
Python Code Examples
HTML Code Examples
CSS Code Examples
JavaScript Code Examples
Online Editor
C Code Editor
C++ Code Editor
C# Code Editor
Java Code Editor
Python Code Editor
HTML Code Editor
CSS Code Editor
JavaScript Code Editor
Practice how to create switch like statement in Python
Python Online Editor
Execute Code
More Python Sample Codes
import datetime # import datetime to get the day of week #Get the day of the week dayof_week = datetime.date.today().strftime('%A') # Convert the day of week to lowercase to make the comparison case-insensitive day_name = dayof_week.lower() # check the day using if ..elif.. else conditional statement if day_name == "sunday": print(f"Today is {dayof_week}") elif day_name == "monday": print(f"Today is {dayof_week}") elif day_name == "tuesday": print(f"Today is {dayof_week}") elif day_name == "wednesday": print(f"Today is {dayof_week}") elif day_name == "thursday": print(f"Today is {dayof_week}") elif day_name == "friday": print(f"Today is {dayof_week}") elif day_name == "saturday": print(f"Today is {dayof_week}") else: print("This is not a day of the week.")