H3NL3Y

Untitled

Nov 28th, 2017
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.84 KB | None | 0 0
  1. #Defining a function
  2. # A function allows you to create code which you can run when ever you want.
  3. #It is useful for things such as a menu system.
  4. #A program which uses functions through out is known as a modular program and this is a known as a higher level method.
  5.  
  6. def menu():
  7.  
  8.   print('WELCOME TO HENNERS MENU SYSTEM')
  9.   menuChoice = input('''Please select one of the following options:
  10.    1. Reminder list
  11.    2. Games list
  12.    3. Logout
  13.    >>> ''')
  14.  
  15.   if menuChoice == '1':
  16.     reminderlist() # This calls the function
  17.   elif menuChoice == '2':
  18.     gameslist() # This calls the function
  19.   elif menuChoice == '3':
  20.     logout() # This calls the function
  21.  
  22.  
  23.  
  24.  
  25.  
  26. def reminderlist():
  27.   print('WELCOME TO REMINDER LIST')
  28.  
  29. def gameslist():
  30.   print('WELCOME TO Games LIST')
  31.  
  32. def logout():
  33.   print('WELCOME TO Logout')
Add Comment
Please, Sign In to add comment