Printing Current Date in Python
To display the current date, you need to successively apply the date and today methods to the datetime module.
Let's display the current date:
pythonres = datetime.date.today()
print(res) # will display the current date
Now let's get the current day, month and year:
pythonprint(res.day) # the day
print(res.month) # the month
print(res.year) # the year
Задание 1
Print the current day to the console.
Задание 2
Display the current month in the console.
Задание 3
Output the current year to the console.