SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Y Daniel Lang
Chapter:
Sets And Dictionaries
Exercise:
Check Point
Question:1 | ISBN:978013274719 | Edition: 6

Question

What are the differences between a list and a tuple? How do you create a tuple from a list? How do you create a list from a tuple?

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

The difference between list and tuple is list is mutable while tuple is imutable.

that means we can change list items.we can add or delete  a list item.

we can not change tuple items.

we can create a tuple from list by using tuple method.

syntax for creating a tuple from a list is

tuple1=tuple(list)

we can create a list  from tuple by using list metod.syntax for creating a list from a tuple is

list1=list(tuple)

0 0

Discussions

Post the discussion to improve the above solution.