Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- adminCourses = ('Slam Poetry 101', 'Eating', 'Farting', 'Intro to Cheeseburgers') #makes your admin courses
- studentCourses = ('Sleeping', 'Failing', 'Water Bottle', 'uhhhh') #makes student courses
- courses = {} #makes an empty dictionary
- courses['admin'] = adminCourses #creates a key and assigns values
- courses['student'] = studentCourses
- print('This is a menu')
- print('Press 1 for admin courses')
- print('Press 2 for student courses')
- userInput = input()
- if userInput == '1':
- for x in courses.get('admin'): #dictionary.get(key) will return the values and you're looping over it in a for loop. So for each loop, x will be the next item in the list
- print(x)
- if userInput == '2':
- for x in courses.get('student'):
- print(x)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement