информатика Пайтон. ​

Приложения:

Ответы

Ответ дал: abramabra77
1

попробуй це
import datetime

while True:

 # Display the menu

 print("1. Display the time")

 print("2. Display the date")

 print("3. Quit")

 # Read the user's input

 choice = input()

 # If the user chose to display the time, show the time

 if choice == "1":

   # Get the current time

   now = datetime.datetime.now()

   # Format the time as a string with milliseconds

   time_str = now.strftime("%I:%M:%S.%f %p")

   # Print the time

   print(time_str)

 # If the user chose to display the date, show the date

 elif choice == "2":

   # Get the current date

   now = datetime.datetime.now()

   # Format the date as a string

   date_str = now.strftime("%m/%d/%Y")

   # Print the date

   print(date_str)

 # If the user chose to quit, break out of the loop

 elif choice == "3":

   break

Вас заинтересует