Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- daily_number = int(input())
- name_of_fish = input()
- counter = 0
- price = 0
- final_price = 0
- while name_of_fish != "Stop":
- kilograms = float(input())
- price = 0
- for i in range(0, len(name_of_fish)):
- sum = name_of_fish[i]
- price += ord(sum)
- total_price = price / kilograms
- counter += 1
- if counter % 3 != 0:
- final_price -= total_price
- else:
- final_price += total_price
- if counter == daily_number:
- print("Lyubo fulfilled the quota!")
- break
- else:
- name_of_fish = input()
- if final_price > 0:
- print(f"Lyubo's profit from {counter} fishes is {final_price:.2f} leva.")
- else:
- print(f"Lyubo lost {abs(final_price):.2f} leva today.")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement