-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlist.py
More file actions
55 lines (54 loc) · 900 Bytes
/
list.py
File metadata and controls
55 lines (54 loc) · 900 Bytes
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
l=[]
print(l)
l.append(22)
print(l)
l.insert(1,99)
print(l)
l[1]=55
print(l)
a=[33,96,56,75,96]
b=['ram','Python','HELLO','List']
a.insert(2,57)
print(a)
print(b)
print(max(a))
print(min(a))
a.sort()
print(a)
a.sort(reverse=True) #decreasing order
print(a,"reverse")
b.sort()
print(b)
b.sort(key=str.lower)
print(b,"yes ")
print(b.index('Python'))
a.remove(96) # if more than value it remove first instance
print(a)
c=a*2
print(c)# list shows multiple list
d=[a,b]
print(d)
print(d[0][1])
print(list(range(10)))
print(list("hello"))
print('ram'in b[1])
print(a)
del a[1]
x=[44,63,96,44,]
print(x)
print(x.count(44))
(x.pop())# element remove from end if value notgiven if value is given it remove only that value
print(x)
a=[94,66,34,52,88,76]
a.sort()
print(len(a))
f=a[:3]
print(f)
g=a[2:]
print(g)
h=a[2:5]
print(h)
# for n in range (a):
# print(n)
# for n in range (len(a)):
# print(n)