-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDay2
More file actions
115 lines (53 loc) · 1.33 KB
/
Day2
File metadata and controls
115 lines (53 loc) · 1.33 KB
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
"""
#Adding NONE values to list.
t1 = 1,2,3,[2,4];
tempList = list(t1); #convert to list
print(tempList);
one = tempList.pop(3);
one = [];
tempList.append(one);
print(tuple(tempList));
str = "Chinmay";
temp =list(str);
print(temp);
temp[2:3] = []; #remove1
print(temp);
temp.remove("C"); #remove 2
print(temp);
temp = [1,3,4,5,6,7];
print "Temp :",temp;
temp[2:5] = [10,11,12];
print "New Value of temp :",temp[::-1];
temp = [1,3,4,5,6,7];
print "Temp :",temp;
temp.append([]);
print "New Value of temp :",temp;
temp = [17,1,3,5,0];
print "Temp :",temp;
temp.insert(2,[3,4]);
print "New Value of temp :",temp;
print "return value: ",temp.pop(2);
temp.sort(reverse=True);
print "New Value of temp :",temp
original ={1,"Chinmay"},{2,"Kulkarni"};
print "original::",original;
tu = {2,"Kulkarni"};
print "small set::",tu;
print "",tu.issubset(original[1]);
"""
msg = {1:"Chinmay",2:"Kulkarni"};
print msg[2];
msg[3] = "Ashutosh";
print msg.keys();
print msg.values();
listOne=[1,2,3]
new_listOne =[x*2 for x in listOne]
print listOne,new_listOne;
str= ["one","one","one","one"];
new_str = [word.upper() for word in str];
print new_str;
dictionaryOne = [1, 2, 3, 4] #it is a list
dictionaryTwo = {x: x * x for x in dictionaryOne }
print dictionaryTwo
for i in range(0,10):
print(i)