Recent Posts

List

Python Lists



The list is a most versatile datatype available in Python which can be written as a list of comma-separated values (items) between square brackets. The important thing about a list is that items in a list need not be of the same type.
Creating a list is as simple as putting different comma-separated values between square brackets.
For example:
list1 = ['math', 'history', 2005, 2019];
list2 = [1, 2, 3, 4, 5 ];
list3 = ["a", "b", "c", "d"]

We can check it out as index as well, with the 0,1,2,3,4 order

2
-1
From 2, till the end


From 1 till 4, but it won't show #4


We can set a new value


Write a program to find the largest number in a list







List List Reviewed by ohhhvictor on May 06, 2019 Rating: 5

No comments:

Facebook

 photo imagen120.jpg
Theme images by 5ugarless. Powered by Blogger.