Advertisement
Guest User

Untitled

a guest
Apr 27th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. # define the shut_down function
  2. def shut_down(s):
  3.     if s == 'yes':
  4.         return 'Shutting down'
  5.     elif s == 'no':
  6.         return 'Shutdown aborted'
  7.     else:
  8.         return 'Sorry'
  9.  
  10. # testing
  11. print shut_down('yes') # will return 'Shutting down'
  12. print shut_down('no') # will return 'Shutdown aborted'
  13. print shut_down('foo') # will return 'Sorry'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement