Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def flights(*args):
- flights = {}
- destination = [i for i in args[:args.index('Finish')] if not str(i).isdigit()]
- passengers = [int(i) for i in args[:args.index('Finish')] if str(i).isdigit()]
- for i, j in zip(destination, passengers):
- if i not in flights:
- flights[i] = j
- else:
- flights[i] += j
- return flights
Advertisement
Add Comment
Please, Sign In to add comment