List and it's function in python

technical talkiess
0

 print("List and it's function ")


list1 = ['vishal','lakhan','dada','kaka','test','vaishali']


# print(list1)

# if you want to the particular element of the list 

# print(list1[1])

# add some element in the list 

# list1.append("append in the list")

# print(list1)

# remove some elemnet in the list .... remove the last element 

# list1.pop()

print(list1)

# if you want add element particular key then you can simply use 

# list1.insert(2,"Test 1")

# if you want to the particular key value then use the following code 

list1[1] = "WWW.visal.com"

# print(list1)


# if you can't allow the change the any value in the given .... so you can use the tuple

tuple123 = (1,2,3)


tuple123[1] = "asasd"

print(tuple123)

Tags

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)