Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

The laboratory work 9

.docx
Скачиваний:
8
Добавлен:
11.11.2022
Размер:
1.54 Mб
Скачать

The laboratory work 9

Exercise 1: Print current date and time in Python

Solution:

Exercise 2: Convert string into a datetime object

For example, you received the following date in string format. Please convert it into Python’s datetime object.

Solution:

Exercise 3: Subtract a week (7 days) from a given date in Python

Given:

Exercise 4: Print a date in the following format

Solution:

Exercise 5: Find the day of the week of a given date

Solution:

Exercise 6: Add a week (7 days) and 12 hours to a given date

Solution:

Exercise 7: Print current time in milliseconds

Exercise 8: Convert the following datetime into a string

Solution:

Exercise 9: Calculate the date 4 months from the current date

Expected output:

Solution:

Exercise 10: Calculate number of days between two given dates

Solution:

Соседние файлы в предмете Администрирование систем и сетей