A list is a collection which is ordered and changeable. In Python lists are written with square brackets.
Example
Create a List:
thislist = ["python", "dbms", "html"]
print(thislist)
Output
["python", "dbms", "html"]
Example
Change the second item:
thislist = ["python", "dbms", "html"]
thislist[1] = "Number System"
print(thislist)
Output
["python", "Number System", "html"]
Comments
Post a Comment