What are lists and tuples?

Question

 What is the key difference between the two?

in progress 0
Pragya Rani 55 years 1 Answer 684 views Contributor 0

Answer ( 1 )

  1. . The major difference is that a list is mutable, but a tuple is immutable. Examples:
    1. >>> mylist=[1,3,3]
    2. >>> mylist[1]=2
    3. >>> mytuple=(1,3,3)
    4. >>> mytuple[1]=2

Leave an answer

Browse
Browse