Wednesday, 2 November 2016

Lists in Python

Hi All,

Lists are some kinds of advanced arrays.

list.py

----------------------------------------------------------------------------
student=['Rajeev','Kollam',1977,39]
print student[0:3]
----------------------------------------------------------------------------

Run this program.
This will display elements from index '0 to '3'

Some help hints about list
1. del list[1] - remove item in the position '1'
2. len(list) - give you the size of list
3.list=list*2 - append the same list at the end

Try more

 

No comments:

Post a Comment