Wednesday, November 20, 2019

clear method in python

clear method is used for to clear entire list ,list elements

a=[10,20,30]
print(a)
a.clear()
print(a)

output:
[10, 20, 30]
[]

No comments:

Post a Comment

python class topic video