Build in methods available for lists

Hi here I have tried to create a program to use all the methods used in a list :

 

colors = ['Green','Red', 'Blue','white','violet']
fruits = ['mango','grape','orange']
colors.append('Yello')
print colors
colors.insert(4,"rose")
print colors
colors.extend(fruits)
print colors
print colors.index('rose')
colors.remove('grape')
print colors
colors.pop(1)
print colors

No comments:

Post a Comment