From 1bb29cfb72556de4b011c802f983dbee36d26836 Mon Sep 17 00:00:00 2001 From: Neuf Date: Mon, 15 Sep 2025 20:26:50 +0500 Subject: [PATCH] =?UTF-8?q?8-=D0=B7=D0=B0=D0=B4=D0=B0=D0=BD=D0=B8=D0=B5=20?= =?UTF-8?q?=D0=B2=D1=8B=D0=BF=D0=BE=D0=BB=D0=BD=D0=B5=D0=BD=D0=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Module16/08_songs/main.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Module16/08_songs/main.py b/Module16/08_songs/main.py index 0d14d68..c218c13 100644 --- a/Module16/08_songs/main.py +++ b/Module16/08_songs/main.py @@ -11,3 +11,15 @@ violator_songs = [ ] # TODO здесь писать код +summ_time = 0.00 + +amount = int(input('Сколько песен выбрать? ')) + +for i in range(1, amount + 1): + song = input(f'Название {i}-й песни: ') + for song_option in violator_songs: + if song_option[0] == song: + summ_time += song_option[1] + break + +print(f'Общее время звучания песен: {round(summ_time, 2)} минуты') \ No newline at end of file