List in Python...|empty list | retrieve list.
List:
In python a list is a sequence of values called items or elements. The elements can be any datatype like integer,string or float values. The items or elements are placed between the '[]',separated with ','.
Creating List:
The list class define List. A programmer can use list constructor to create a list.
Output:
Creating List without using Constructor:
Output:
Retrieve the elemements of List :
The elements of list are access by index operator.>
Syntax:
Example:
Output:
A python program to create empty list and add item according to user need and display them.
Output:
Comments
Post a Comment