Advertisement
LightProgrammer000

Orcamento [python 2]

Sep 5th, 2019
456
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.89 KB | None | 0 0
  1. import os
  2.  
  3. # Variaveis
  4. a = 0
  5. acumulador = 0
  6. limite = 50 * pow(10, 6)
  7.  
  8. while True:
  9.    
  10.     os.system("clear")
  11.     print("\033[01;34m ------------------------------------- \033[01;37m")
  12.     print("\033[01;35m -------- ORCAMENTO TEMPO REAL ------- \033[01;37m")
  13.     print("\033[01;34m ------------------------------------- \033[01;37m")
  14.     print("")
  15.     print("\033[01;32m # Caixa : " + str(float(limite-a)) + "\033[01;37m" )
  16.     print("\033[01;31m # Despesas : " + str(float(acumulador)) + "\033[01;37m")
  17.    
  18.     # Entrada de dados
  19.     a = float(raw_input("\033[01;36m\n * Digite o valor: \033[01;37m"))
  20.     acumulador += a
  21.  
  22.     if a > limite:
  23.         print("\033[01;33m\n => Nao tem dinheiro \n\033[01;36m")
  24.         break
  25.  
  26.     elif acumulador <= limite:
  27.         continue
  28.  
  29.     elif acumulador > limite:
  30.         print("\033[01;33m\n => Nao tem dinheiro \n\033[01;36m")
  31.         break
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement