Advertisement
exDotaPro

27_july_2019_4_best_plane_tickets

Jan 5th, 2020
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.61 KB | None | 0 0
  1. import sys
  2.  
  3. flight = input()
  4. least_minutes_stay = sys.maxsize
  5.  
  6. while flight != 'End':
  7.     ticket_number = flight
  8.     ticket_price = int(input())
  9.     minutes_stay = int(input())
  10.     flight = input()
  11.  
  12.     if minutes_stay < least_minutes_stay:
  13.         least_minutes_stay = minutes_stay
  14.         current_ticket_number = ticket_number
  15.         current_ticket_price = ticket_price * 1.96
  16.  
  17. hours = int(least_minutes_stay / 60)
  18. minutes = least_minutes_stay % 60
  19.  
  20. if flight == 'End':
  21.     print(f'Ticket found for flight {current_ticket_number} costs {current_ticket_price:.2f} leva with {hours}h {minutes}m stay')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement