Tuesday, November 19, 2019

append method in python

single element adding by using append method
l=[]
l.append(10)
print(l)

output:
[10]


multiple methods adding by using append method
l=[]
l.append(10)
l.append(20)
l.append(30)
l.append(40)
print(l)

output:
[10, 20, 30, 40]

No comments:

Post a Comment

python class topic video