LIST CREATION
- List is sequence which can store value of and kind.
CREATION OF LIST
- >>>Mylist = list('hello')
['h','e','l','l,'o']
- >>>L1= list(input("enter list element"))
>>> L1
(1,2,3,4,5)
eval( ) function identifier type of passed string and then return it.
>>>a="15"
>>>b="25"
>>>print(a+b)
1525
>>>print(eval(a)+eval(b))
40
Accessing of list
- len( ) function is used to get the length of list.
- L[i] will return the value exist at index.
- L[i:j] will return a new list with the values from i index to j list excluding j index.
Transverse of list
Transverse of a list means to access and process each and every element of that list.
No comments:
Post a Comment