Advertisement
Guest User

Untitled

a guest
Dec 5th, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. s=', '.join(['{0} to {1}'.format(x[0], x[1]) for x in Availability])
  2. print('You have availability ' + s)
  3.  
  4. You have availability 8:00 to 8:45, 9:15 to 9:30, 10:00 to 10:15.
  5.  
  6. s=', '.join(['{0} to {1}'.format(x[0], x[1]) if x!=a[-1] else 'and {0} to {1}'.format(x[0], x[1]) for x in a])
  7. print('You have availability ' + s)
  8.  
  9. You have availability 8:00 to 8:45, 9:15 to 9:30, and 10:00 to 10:15
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement