daily pastebin goal
60%
SHARE
TWEET

Untitled

a guest Jan 17th, 2019 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def report_status(scheduled_time, estimated_time):
  2.     ''' (number, number) -> str
  3.  
  4.    Return the flight status (on time, early, delayed)
  5.    for a flight that was scheduled to arrive at
  6.    scheduled_time, but is now estimated to arrrive
  7.    at estimated_time.
  8.  
  9.    Pre-condition: 0.0 <=scheduled_time <24 and
  10.    0.0 <= estimated_time < 24
  11.  
  12.    >>> report_status(14.3, 14.3)
  13.    'on time'
  14.    >>> report_status(12.5, 11.5)
  15.    'early'
  16.    >>> report_status(9.0, 9.5)
  17.    'delayed'
  18.    '''
  19.  
  20.     if scheduled_time == estimated_time:
  21.         return 'on time'
  22.     elif scheduled_time > estimated_time:
  23.         return 'early'
  24.     else:
  25.         return 'delayed'
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top