Q:

Print a date in a the following format using python programming

belongs to collection: Python Date and Time Exercises

0

Print a date in a the following format

Day_name  Day_number  Month_name  Year

Given:

given_date = datetime(2020, 2, 25)

Expected output:

Tuesday 25 February 2020

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Solution:

from datetime import datetime

given_date = datetime(2020, 2, 25)
print("Given date is")
print(given_date.strftime('%A %d %B %Y'))

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Find the day of the week of a given date using pyt... >>
<< Subtract a week (7 days) from a given date in Pyt...