elizeub

Conversor Temperatura Celsius em Fahrenheit e vice versa python

Jul 14th, 2021 (edited)
561
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.06 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. # Este software conferte \u00baC em \u00baF e vice versa
  3. # Elizeu Barbosa Abreu
  4.  
  5. print('{:.^40}'.format('CONVERSOR DE TEMPERATURAS'))
  6. print('{:.>40}'.format(''))
  7. continua = True
  8. while continua == True:
  9.     conversao = input('Digite: C para converter \u00baC em \u00baF | F para converter \u00baF em \u00baC | P para parar: ')
  10.     if conversao == 'C' or conversao == 'c':
  11.         c = float(input('Entre com o valor em \u00baC: '))
  12.         f = ((c*9)/5)+32
  13.         print('{:.>40}'.format(''))
  14.         print('{:2.2f}\u00baC => {:2.2f}\u00baF'.format(c,f))
  15.         print('{:.>40}'.format(''))
  16.     elif conversao == 'F' or conversao == 'f':
  17.         f = float(input('Entre com o valor em \u00baF: '))
  18.         c = 5/9*(f-32)
  19.         print('{:.>40}'.format(''))
  20.         print('{:2.2f}\u00baF => {:2.2f}\u00baC'.format(f,c))
  21.         print('{:.>40}'.format(''))
  22.     elif conversao == 'P' or conversao == 'p':
  23.         print('{:.>40}'.format('Bye Bye'))
  24.         continua = False
  25.     else :
  26.         print('Opcao Invalida: Digite C, F ou P')
  27.  
  28.  
Add Comment
Please, Sign In to add comment