From a3ffc6d1a37a3485a169d91a1d1007cded6b9b84 Mon Sep 17 00:00:00 2001 From: Katerina Date: Sun, 19 Oct 2025 22:27:22 +0300 Subject: [PATCH] task5 --- TEMA4/task.py | 31 +++++++++++++++++++------------ 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/TEMA4/task.py b/TEMA4/task.py index db97096..eb06a40 100644 --- a/TEMA4/task.py +++ b/TEMA4/task.py @@ -4,17 +4,24 @@ import time import random import string import statistics -print(math.floor((round(cmath.phase(0.2+0.8j), 2) * 20) / 3), (round(cmath.phase(0.2+0.8j), 2) * 20) % 3) -msc_time = time.localtime(time.time() + 3 * 3600); print(msc_time) -mytime = f"{msc_time.tm_hour:02d}:{msc_time.tm_min:02d}"; print(mytime) +print(divmod(((round(cmath.phase(0.2+0.8j),2)) * 20),3)) +msc_time = time.localtime(); msc_time +hm=(f'{msc_time.tm_hour}:{msc_time.tm_min}') +print(hm) wd = ['Понедельник', 'Вторник', 'Среда', 'Четверг', 'Пятница', 'Суббота', 'Воскресенье'] -p = random.sample(wd, 3); print(p) -k = list(range(14, 33, 3)); print(k) - rand = random.choice(k); print(rand) +p = random.sample(wd, 3); +print(p) +k = list(range(14, 33, 3)) +print(k) +rand = random.choice(k) +print(rand) N = round(random.gauss(15, 4)) -N=max(1,N); print(N) -rl = random.choices(string.ascii_uppercase, k=N); print(rl) -['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();print(c) -inter_sec = c - time.mktime(msc_time); print(inter_sec) -inter_min = round(inter_sec / 60, 2); print(inter_min) +print(N) +p=random.sample(string.ascii_letters, N) +print(p) +c = time.time()+3*3600 +print(c) +inter_sec = c - time.mktime(msc_time) +print(inter_sec) +inter_min = round(inter_sec / 60, 2) +print(inter_min)