ответвлено от main/python-labs
minor changes in task.md
Этот коммит содержится в:
@@ -23,9 +23,21 @@ divmod(round(cmath.phase(0.2+0.8j),2)*20,3)
|
|||||||
|
|
||||||
# Punkt 2
|
# Punkt 2
|
||||||
import time
|
import time
|
||||||
localTime = time.localtime()
|
Time = time.time()
|
||||||
print("Current time: {}:{}".format(localTime.tm_hour, localTime.tm_min))
|
Time
|
||||||
Current time: 15:31
|
1760948732.7906492
|
||||||
|
type(Time)
|
||||||
|
<class 'float'>
|
||||||
|
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)
|
||||||
|
<class 'time.struct_time'>
|
||||||
|
print("Current time: {}:{}".format(MosTime.tm_hour, MosTime.tm_min))
|
||||||
|
Current time: 11:25
|
||||||
|
|
||||||
# Punkt 3
|
# Punkt 3
|
||||||
import random
|
import random
|
||||||
@@ -52,4 +64,13 @@ letters
|
|||||||
timeDiff = round(time.time() - time.mktime(localTime))
|
timeDiff = round(time.time() - time.mktime(localTime))
|
||||||
print(timeDiff // 60, "minutes and", timeDiff % 60, "seconds")
|
print(timeDiff // 60, "minutes and", timeDiff % 60, "seconds")
|
||||||
3 minutes and 27 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
|
||||||
```
|
```
|
||||||
Ссылка в новой задаче
Block a user