-
Notifications
You must be signed in to change notification settings - Fork 0
/
lists
41 lines (41 loc) · 862 Bytes
/
lists
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
Marks=[3,5,6,"Samaksh",True,8.2,]
print(Marks)
print(type(Marks))
print(Marks[0])
print(type(Marks[0]))
print(Marks[1])
print(type(Marks[1]))
print(Marks[2])
print(type(Marks[2]))
print(Marks[3])
print(type(Marks[3]))
print(Marks[4])
print(type(Marks[4]))
print(Marks[5])
print(type(Marks[5]))
print(Marks[-3]) #Negative index
print(Marks[len(Marks)-3]) #Positive index
print(Marks[6-3]) #Positive index
print(Marks[3]) #Positive index
print(Marks[:])
print(Marks[1:-1])
print(Marks[1:6])
print(Marks[1:6:2])
if 7 in Marks:
print("Yes")
else:
print("No")
if "ama" in "Samaksh":
print("Yes")
else:
print("No")
Number=[i for i in range(12)]
print(Number)
Squares=[i*i for i in range(12)]
print(Squares)
Cubes=[i*i*i for i in range(12)]
print(Cubes)
Even=[i for i in range(12) if i%2==0]
print(Even)
Odd=[i for i in range(12) if i%2!=0]
print(Odd)