Advertisement
Guest User

Untitled

a guest
Aug 7th, 2020
757
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 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.  
  20. if salary > 0:
  21.     print(int(salary))
Advertisement
Comments
  • AKoo7
    1 year
    # Python 0.43 KB | 0 0
    1. num = int(input())
    2. salary = int(input())
    3.  
    4. Facebook = 150
    5. Instagram = 100
    6. Reddit = 50
    7.  
    8.  
    9. for i in range(1, num + 1):
    10.    
    11.     if salary <= 0:
    12.         print("You have lost your salary.")
    13.         break
    14.  
    15.     sites = input()
    16.  
    17.     if sites == "Facebook":
    18.         salary -= Facebook
    19.     elif sites == "Instagram":
    20.         salary -= Instagram
    21.     elif sites == "Reddit":
    22.         salary -= Reddit
    23.  
    24. if salary > 0:
    25.     print(salary)
Add Comment
Please, Sign In to add comment
Advertisement