Advertisement
FelipeNeto2

RECEITA DA EMPRESA

Jul 23rd, 2019
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.53 KB | None | 0 0
  1. n = int(input("empresa:"))
  2. m = int(input("mês:"))
  3.  
  4. empresa = 1
  5. while empresa <= n:
  6.   mes = 1
  7.   balanca = 0
  8.   print("Empresa {}".format(empresa))
  9.   while mes<=m:
  10.     print("Mês {}:".format(mes))
  11.     ganho=int(input("ganho no mês: "))
  12.     gasto=int(input("gasto no mês: "))
  13.     balanca = balanca+(ganho-gasto)
  14.     mes = mes+1
  15.  
  16.   if balanca == 0:
  17.     print("A empresa ficou na mesma!")
  18.   if balanca > 0:
  19.     print("lucro: {}".format(balanca))
  20.   else:
  21.     print("perdeu: {}".format(balanca))      
  22.  
  23.   empresa= empresa +1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement