Python list datatype

 python list datatype:

list is a flexible, versatile, powerful, and popular built-in data type.

store multiple values in single variable and different datatypes


we can use list datatype in two ways

one is direct list variable

ex:

mylist=[10,20,40,50,90]

print(mylist)


second one is

list() constructor its class name

ex:

mylist=list([10,30,40,60,90])

print(mylist)


list heterogeneous items
heterogeneous means group of datatypes
Ex:
mylist = [10, 20, 'ram', 12.50, 'praveen', 25, 50]
print(mylist)

No comments:

Post a Comment

Latest Post

How to Generate Barcode and QR code For Our Products

 మీ products కి barcode / QR code generate చేయాలంటే OPTION 1: ONLINE (No Coding – Quick) Best for small shops / beginners 👉Free websites: T...