3 List Data Types

 '''

1. List is used to store multiple values and 

we can do operation on each value based on index.

2. Using square brackets "[]" we can create a list

3. List is a mutable object

'''

# To create a list

l=[1,2,3,4,5]

names = ['uma','kumar','balu','mahesh', 567, 99.9]

print(names)

print(names[0])

print(id(names))


# To update a particular value

# names[0] = 'uma mahesh'

# print(names[0])

# print(id(names))


# To delete particular value in list

#del names[2]


# To delete a total list

#del names


# To print particular value based on index

#print(names[4])

#print(names[-2])



Comments

Popular posts from this blog

1 PYTHON PROGRAMMING

16 file handling in python

4 Tuple data types