forked from HARITIKAPANDIT/NOTEBOOK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathUntitled2.py
99 lines (37 loc) · 795 Bytes
/
Untitled2.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/env python
# coding: utf-8
# In[4]:
#working with lists
#making two lists
student =[52,35,65,41,53]
classes =["10A","12B","10B","11A","10C"]
#using index() to get the index
ind_11A = classes.index("11A")
#printing the index
ind_11A
# In[5]:
#printing the student no. of class 11A
student[ind_11A]
# In[7]:
#working with dictionaries
#creating a dictionary school
school = {"10A" : 52, "12B" : 35, "10B" : 65, "11A" : 41, "10C" : 53}
#printing student in class 11A
school["11A"]
# In[8]:
#adding element to the existing dictionary
school["12A"]=45
#printing the list
school
# In[9]:
#removing any element from list
del(school["12A"])
#printing the list
school
# In[ ]:
# In[ ]:
# In[ ]:
# In[ ]:
# In[ ]:
# In[ ]:
# In[ ]: