_bzium

Untitled

May 9th, 2023
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. get_degrees = input("Podaj temperaturę: ")
  2. get_unit = input("Podaj jednostkę [C/K]: ")
  3.  
  4. if get_unit == 'C':
  5.     converted_degrees = int(get_degrees) + 273.15
  6.     print(f"{get_degrees} stopni C jest równoznaczne z {converted_degrees} K")
  7. elif get_unit == 'K':
  8.     converted_degrees = int(get_degrees) - 273.15
  9.     print(f"{get_degrees} stopni K jest równoznaczne z {round(converted_degrees, 2)} C")
  10. else:
  11.     print("Proszę wpisz C lub K")
Advertisement
Add Comment
Please, Sign In to add comment