From 76cd9a3978b6ac00afa43c4b53062810b8e79fa8 Mon Sep 17 00:00:00 2001 From: Dmitry Kolomeytsev Date: Mon, 20 Oct 2025 11:42:53 +0300 Subject: [PATCH] minor changes in task.md --- TEMA4/task.md | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/TEMA4/task.md b/TEMA4/task.md index 31501b3..8e278e2 100644 --- a/TEMA4/task.md +++ b/TEMA4/task.md @@ -23,9 +23,21 @@ divmod(round(cmath.phase(0.2+0.8j),2)*20,3) # Punkt 2 import time -localTime = time.localtime() -print("Current time: {}:{}".format(localTime.tm_hour, localTime.tm_min)) -Current time: 15:31 +Time = time.time() +Time +1760948732.7906492 +type(Time) + +MosTimeSeconds = Time + 3*60*60 +MosTimeSeconds +1760959532.7906492 +MosTime = time.gmtime(MosTimeSeconds) +MosTime +time.struct_time(tm_year=2025, tm_mon=10, tm_mday=20, tm_hour=11, tm_min=25, tm_sec=32, tm_wday=0, tm_yday=293, tm_isdst=0) +type(MosTime) + +print("Current time: {}:{}".format(MosTime.tm_hour, MosTime.tm_min)) +Current time: 11:25 # Punkt 3 import random @@ -52,4 +64,13 @@ letters timeDiff = round(time.time() - time.mktime(localTime)) print(timeDiff // 60, "minutes and", timeDiff % 60, "seconds") 3 minutes and 27 seconds + + +current_time = time.time()+3*3600 +time_seconds = round(current_time - MosTimeSeconds) +time_minutes = round(time_seconds / 60) + +print("Время, прошедшее с 2 пункта: {}:{}".format(time_minutes, time_seconds%60)) + +Время, прошедшее с 2 пункта: 15:55 ``` \ No newline at end of file