GeorgiLukanov87

basic exam haircut easy

Apr 15th, 2022 (edited)
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.81 KB | None | 0 0
  1. target_money = int(input())
  2. command = input()
  3. target_complete = False
  4. total_sum = 0
  5. while command != 'closed':
  6.     current_order = command
  7.     type_order = input()
  8.     if current_order == 'haircut':
  9.         if type_order == 'mens':
  10.             total_sum += 15
  11.         elif type_order == 'ladies':
  12.             total_sum += 20
  13.         else:
  14.             total_sum += 10
  15.     elif current_order == 'color':
  16.         if type_order == 'touch up':
  17.             total_sum += 20
  18.         else:
  19.             total_sum += 30
  20.     if total_sum >= target_money:
  21.         print(f"You have reached your target for the day!")
  22.         target_complete = True
  23.         break
  24.     command = input()
  25. if not target_complete:
  26.     print(f"Target not reached! You need {target_money-total_sum}lv. more.")
  27. print(f"Earned money: {total_sum}")
Add Comment
Please, Sign In to add comment