Multiple lists


#1

  1. in spite of the error i am getting the proper list.. reason for the error
  2. what is the reason i am getting 5 output

  3. and finally i am reading some python resources it mentions a word called tuple.
    which is
    tuple :

noun COMPUTING
noun: tuple; plural noun: tuples
a data structure consisting of multiple parts.
(in a relational database) an ordered set of data constituting a record..

so how does tuple apply to the list and dictionaries.
the entire list is one tuple or , each element is one tuple??
also is the entire dictionary one tuple or each list is one tuple.?


#2

no? A tuple is a immutable list. Its just another way to store data just like dictionaries and lists

we use zip() to loop over two list at the same time, you should compare the values which each other, to see which is bigger

for example, for the first run of the loop a contains 3 and b contains 2. If a is bigger, print a, else print b

so check if a is bigger then b, so that it works for all values in lists


#3

great
that solved it,
i think i had got the question wrong...!!


#4

and i also understood what zip does.. it goes through the items in the list.. and executes a given code...
interesting..


#5

it seems you did

that is good to hear :slight_smile:

well, we can use a normal loop to go through items in the list, the special thing about zip is that we can get through items of 2 lists at the same time


#6

thank you .. very much


#7