Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Defining a function
- # A function allows you to create code which you can run when ever you want.
- #It is useful for things such as a menu system.
- #A program which uses functions through out is known as a modular program and this is a known as a higher level method.
- def menu():
- print('WELCOME TO HENNERS MENU SYSTEM')
- menuChoice = input('''Please select one of the following options:
- 1. Reminder list
- 2. Games list
- 3. Logout
- >>> ''')
- if menuChoice == '1':
- reminderlist() # This calls the function
- elif menuChoice == '2':
- gameslist() # This calls the function
- elif menuChoice == '3':
- logout() # This calls the function
- def reminderlist():
- print('WELCOME TO REMINDER LIST')
- def gameslist():
- print('WELCOME TO Games LIST')
- def logout():
- print('WELCOME TO Logout')
Add Comment
Please, Sign In to add comment