ответвлено от main/python-labs
task4
Этот коммит содержится в:
@@ -22,13 +22,14 @@
|
|||||||
>>> import string
|
>>> import string
|
||||||
>>> import statistics
|
>>> import statistics
|
||||||
|
|
||||||
>>> math.floor((round(cmath.phase(0.2+0.8j), 2) * 20) / 3), (round(cmath.phase(0.2+0.8j), 2) * 20) % 3
|
>>> divmod(((round(cmath.phase(0.2+0.8j),2)) * 20),3)
|
||||||
(8, 2.6000000000000014)
|
(8.0, 2.6000000000000014)
|
||||||
|
|
||||||
|
>>> msc_time = time.localtime(); msc_time
|
||||||
|
time.struct_time(tm_year=2025, tm_mon=10, tm_mday=19, tm_hour=22, tm_min=7, tm_sec=14, tm_wday=6, tm_yday=292, tm_isdst=0)
|
||||||
|
>>> hm=(f'{msc_time.tm_hour}:{msc_time.tm_min}'); hm
|
||||||
|
'22:7'
|
||||||
|
|
||||||
>>> msc_time = time.localtime(time.time() + 3 * 3600); msc_time
|
|
||||||
time.struct_time(tm_year=2025, tm_mon=10, tm_mday=6, tm_hour=4, tm_min=50, tm_sec=40, tm_wday=0, tm_yday=279, tm_isdst=0)
|
|
||||||
>>> mytime = f"{msc_time.tm_hour:02d}:{msc_time.tm_min:02d}"; mytime
|
|
||||||
'04:50'
|
|
||||||
|
|
||||||
>>> wd = ['Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота', 'Воскресенье']
|
>>> wd = ['Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота', 'Воскресенье']
|
||||||
>>> p = random.sample(wd, 3); p
|
>>> p = random.sample(wd, 3); p
|
||||||
@@ -39,18 +40,17 @@ time.struct_time(tm_year=2025, tm_mon=10, tm_mday=6, tm_hour=4, tm_min=50, tm_se
|
|||||||
>>> rand = random.choice(k);rand
|
>>> rand = random.choice(k);rand
|
||||||
14
|
14
|
||||||
|
|
||||||
>>> N = round(random.gauss(15, 4))
|
>>> N = round(random.gauss(15, 4)); N
|
||||||
>>> N=max(1,N); N
|
14
|
||||||
22
|
>>> p=random.sample(string.ascii_letters, N); p
|
||||||
>>> rl = random.choices(string.ascii_uppercase, k=N); rl
|
['s', 'h', 'd', 'L', 'i', 'C', 'z', 'P', 'k', 'y', 'D', 'l', 'H', 'Z']
|
||||||
['J', 'Y', 'Z', 'Z', 'I', 'W', 'F', 'Y', 'B', 'H', 'G', 'N', 'B', 'F', 'B', 'D', 'P', 'Y', 'R', 'I', 'R', 'C']
|
|
||||||
|
|
||||||
>>> c = time.time();c
|
>>> c = time.time()+3*3600;c
|
||||||
1759705212.9430156
|
1760912196.5972443
|
||||||
>>> inter_sec = c - time.mktime(msc_time);inter_sec
|
>>> inter_sec = c - time.mktime(msc_time);inter_sec
|
||||||
-10227.056984424591
|
11362.597244262695
|
||||||
>>> inter_min = round(inter_sec / 60, 2); inter_min
|
>>> inter_min = round(inter_sec / 60, 2); inter_min
|
||||||
-170.45
|
189.38
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user