-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArray.py
More file actions
50 lines (37 loc) · 690 Bytes
/
Copy pathArray.py
File metadata and controls
50 lines (37 loc) · 690 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
x = [1,2,3,4,5]
y = ["mango","banana","apple"]
print(len(x)) #5
print(len(y)) #3
x.append(10)
print(x) #[1,2,3,4,5,10]
z = x.copy()
print(z) #[1,2,3,4,5,10]
z = z.clear()
print(z) #None
x.extend(y)
print(x) #[1, 2, 3, 4, 5, 10, 'mango', 'banana', 'apple']
z = [3,6,5,2,4,1]
z.sort()
print(z) #[1, 2, 3, 4, 5, 6]
z.reverse()
print(z) #[6, 5, 4, 3, 2, 1]
z.pop()
print(z) #[6, 5, 4, 3, 2]
z.pop(3)
print(z) #[6, 5, 4, 2]
'''
--Array Methods--
append()
clear()
copy()
count()
extend()
index()
insert()
pop()
remove()
reverse()
sort()
Visit for example:
https://github.com/nooraalam1/Python_Crash/blob/main/Array%20Methods.pdf
'''