PY
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
# Created by Eswar V
print("Using Append Attribute\n")
asdf = []
asdf.append(10)
asdf.append("Number")
print(asdf)
#By using append attribute we can add elements in list.
#Another Way..
#By using insert attribute we can also add elements in desired place..
print("\n\nUsing Insert Attribute\n")
fdsa = []
fdsa.insert(0,10)
#insert attribute takes two parameters..
#1 - index value - where the element is placed
#2 - element value - value of the element
#insert(index value, element value)
fdsa.insert(1,"Number")
print(fdsa)
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run