Computer >> Computer tutorials >  >> Programming >> Python

What is correct syntax to create Python lists?


List is a collection of comma separated objects, not necessarily of same type, and put inside square brackets []. List object is mutable and an item can appear more than once in the collection.

>>> L1=["Raaj", 23, ["Phy", "Che", "maths"],8.5]