elizeub

Calculadora de Descontos em Python

Jul 13th, 2021 (edited)
367
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.93 KB | None | 0 0
  1. # Este prrograma calcula descontos
  2. # Elizeu Barbosa Abreu
  3. novo = True
  4. while novo == True:
  5.     print('{:_^50}'.format('CALCULADORA DE DESCONTOS'))
  6.     print('{:>50}'.format('OBS.: Use "." no lugar de ",". EX.: R$40.25'))
  7.     valor_do_produto = float(input('\nValor do produto: R$'))
  8.     desconto = float(input('Porcentagem de desconto: %'))
  9.     valor_desconto = valor_do_produto*(desconto/100)
  10.     total_pagar = (valor_do_produto-valor_desconto)
  11.     print('{:_^40}'.format(''))
  12.     print('O produto custava: R${:2.2f}\nDesconto: {:2.0f}%\nDesconto em dinheiro: R${:2.2f}\nValor a Pagar: R${:2.2f}'.format(valor_do_produto, desconto,valor_desconto,total_pagar))
  13.     print('{:_^40}'.format(''))
  14.     c = input('Deseja realizar novo Calculo:\nS para Sim | N para nao : ')
  15.     if c == 's' or c == 'S':
  16.         print('{:_^40}'.format(''))
  17.         novo = True
  18.     else:
  19.         print('{:>50}'.format('Bye Bye'))
  20.         novo = False
  21.    
Add Comment
Please, Sign In to add comment