Решение заданий практикума №6
inputlen.py
protlen.py
hypotenuse.py
alarm.py
1 t = int(input('Enter the current time: '))
2 while t >= 12:
3 t = int(input('Wrong input! Enter the current time again in range from 0 to 11: '))
4
5 a = int(input('Set the alarm time: '))
6
7 l = t + a
8
9 if l < 12:
10 print('The alarm will ring at', l, "o'clock.")
11
12 else:
13 while l >= 12:
14 l -= 12
15 if l < 12:
16 print('The alarm will ring at', l, "o'clock.")
17 break