How to create a list in Python
List
List is a sequence of items separated by commas and
the items are enclosed in square brackets [ ].
#To create a list
list1 = [5,3.4,"New Delhi","20C", 45]
#print the elements of list1
print(list1)
List
List is a sequence of items separated by commas and
the items are enclosed in square brackets [ ].
#To create a list
list1 = [5,3.4,"New Delhi","20C", 45]
#print the elements of list1
print(list1)
Comments
Post a Comment