Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- vaucher = float(input())
- command = input()
- price = 0
- numberOfTickets = 0
- numberOfGoods = 0
- while command != "End":
- if len(command) > 8:
- first = ord(command[0])
- second = ord(command[1])
- price = int(first) + int(second)
- if price <= vaucher:
- numberOfTickets += 1
- else:
- break
- elif len(command) <= 8:
- first = ord(command[0])
- price = int(first)
- if price <= vaucher:
- numberOfGoods += 1
- else:
- break
- vaucher = vaucher - price
- command = input()
- print(f"{numberOfTickets}")
- print(f"{numberOfGoods}")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement