my/l1.py
2026-05-06 15:12:55 +03:00

43 lines
1,023 B
Python
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import sys
pol = input('Начнем(да/нет) ')
sp = []
def poll():
pol1 = float(input('Температура: '))
pol2 = input('Единица (C/F): ')
if pol2=='C':
x = pol1*1.8+32
xx = f'{pol1}C = {x}'
sp.append(xx)
print(f'{pol1}C = {x}')
elif pol2=='F':
f = (pol1 - 32)/1.8
ff = f'{pol1}F = {f}'
sp.append(ff)
print(ff)
else:
print('Введите верную букву')
def his():
print(sp)
def circle():
while True:
if pol=='да':
poll()
print('1. Продолжить\n2. Закончить\n3. История')
po = input('Число ')
if po=='1':
continue
elif po=='2':
sys.exit(1)
elif po=='3':
his()
else:
print('Не то число')
elif pol=='нет':
sys.exit(1)
else:
print('нет')
circle()