Advertisement
pacho_the_python

Untitled

Feb 23rd, 2022
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.84 KB | None | 0 0
  1. number_of_towns = int(input())
  2.  
  3. profit = 0
  4. rain = False
  5.  
  6. for i in range(1, number_of_towns + 1):
  7.     area = input()
  8.     income = float(input())
  9.     expenses = float(input())
  10.     rain = False
  11.    
  12.     if i % 5 == 0:
  13.         rain = True
  14.  
  15.     if rain:
  16.         income = income - income * 0.1
  17.         money = income - expenses
  18.         profit += money
  19.  
  20.         print(f"In {area} Burger Bus earned {money:.2f} leva.")
  21.  
  22.     else:
  23.         if i % 3 == 0:
  24.             expenses += expenses * 0.5
  25.             money = income - expenses
  26.             profit += money
  27.  
  28.             print(f"In {area} Burger Bus earned {money:.2f} leva.")
  29.  
  30.         else:
  31.             money = income - expenses
  32.             profit += money
  33.  
  34.             print(f"In {area} Burger Bus earned {money:.2f} leva.")
  35.  
  36.  
  37. print(f"Burger Bus total profit: {profit:.2f} leva.")
  38.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement