Darlexbg

Fix for exercise 6. Salary

Aug 7th, 2020 (edited)
453
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.45 KB | None | 0 0
  1. tabs = int(input())
  2. salary = int(input())
  3.  
  4. facebook = 150
  5. instagram = 100
  6. reddit = 50
  7.  
  8. for a in range(1, tabs + 1):
  9.     tabs_open = str(input())
  10.  
  11.     if tabs_open == "Facebook":
  12.         salary -= facebook
  13.     elif tabs_open == "Instagram":
  14.         salary -= instagram
  15.     elif tabs_open == "Reddit":
  16.         salary -= reddit
  17.     if salary <= 0:
  18.         print("You have lost your salary.")
  19.         break
  20.  
  21. if salary > 0:
  22.     print(int(salary))
Add Comment
Please, Sign In to add comment