forked from aiti-ghana-2012/Lab_Python_04
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Lab04_1.py
35 lines (27 loc) · 902 Bytes
/
Lab04_1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
print'Lab04: Data Structures'
print
groceries = ['bananas','strawberries','apples','bread']
print'------------------------Lab04_1a-------------------------'
print
#adding champagne to the end of the list
groceries.append('champagne')
print'The new list of groceries are: '
for items in groceries:
print '\t',items
print
print'------------------------Lab04_1b-------------------------'
print
#removing bread from the groceris list
print'The new list of groceries are: '
groceries.remove('bread')
for items in groceries:
print '\t',items
print
print'------------------------Lab04_1c-------------------------'
print
print'Messi can create a dictionary where',
print'the keys are the items and the aisles are the values'
item = raw_input('Please enter your item here: ')
print''
aisles = {'bananas':'b','strawberries':'s','apples':'a','bread':'b'}
print item, 'is in', aisles[item],'aisle'