diff --git a/011-Lists.md b/011-Lists.md index c996409..c1cce65 100644 --- a/011-Lists.md +++ b/011-Lists.md @@ -2,4 +2,19 @@ ## What are lists in Python? -A list is a collection of data and can be applied to a vairable. Lists can comprise of integers, floats and strings. The elements of a list are indexed and have a specific order, meaning you can access specific items within a list using its index number (which always starts at 0 for the first item). +A list is a collection of data and can be applied to a variable. Lists can comprise of integers, floats and strings. The elements of a list are indexed and have a specific order, meaning you can access specific items within a list using its index number (which always starts at 0 for the first item). +You can also print a particular variable from a particular list +An example is illustrated below +Fruits=[Orange,mango,guava,pineapple,apple,waterlemon,banana] +To print a fruit from the list(fruits),we use the print statement+fruits+index of the fruit[-] +Note that index of any list starts from 0. + +#Printing from lists +If we have a list and we want to print from that particular list,we use the print statement+name of the list+index of the value in the list tho index starts from zero(0) +E.g +Animals=[dog,goat,horse,lion,elephant,hen,donkey] +To print lion from list(Animals), +We use-print Animals[3] +To print dog, +We use-print Animals[0] +