DiYane

Salary 6/8

Aug 6th, 2021
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.49 KB | None | 0 0
  1. open_tabs = int(input())
  2. salary = int(input())
  3.  
  4. fine = 0
  5.  
  6. for site in range(open_tabs):
  7.     site_name = input()
  8.  
  9.     if site_name == "Facebook":
  10.         fine = 150
  11.     elif site_name == "Instagram":
  12.         fine = 100
  13.     elif site_name == "Reddit":
  14.         fine = 50
  15.     else:
  16.         fine = 0
  17.  
  18.     salary -= fine
  19.  
  20.     if salary <= 0:
  21.         print("You have lost your salary.")
  22.         break
  23.     # else: # not needed actually
  24.     # continue
  25.  
  26. if salary > 0:
  27.     print(salary)
Advertisement
Add Comment
Please, Sign In to add comment