Computer Science, asked by RUDEGIRL, 11 months ago

What is the difference between list and tuples?

In Python

Answers

Answered by EHSASS
6

★彡 ʜᴇʀᴇ ɪs ʏᴏᴜʀ ᴀɴsᴡᴇʀ 彡★

Difference between list and tuples is here as follow :

LIST

▶️ Lists are mutable i.e they can be edited.

▶️ Lists are slower than tuples.

▶️Syntax: list_1 = [10, ‘Chelsea’, 20]

TUPLES

▶️ Tuples are immutable (tuples are lists which can’t be edited).

▶️ Tuples are faster than list.

▶️ Syntax: tup_1 = (10, ‘Chelsea’ , 20)

ᴇʜsᴀss 彡★

Answered by ItzDevilKing
4

\huge\underline\mathfrak\red{Answer}

_______________________

\large\boxed{\fcolorbox{blue}{white}{Python\:Tuples}}

✨A Tuple is a collection of Python objects separated by commas which is ordered and unchangeable.

✨Python tuple is similar to List except that the objects in tuple are immutable which means we cannot change the elements of a tuple once assigned.

\large\boxed{\fcolorbox{blue}{white}{Python\:List}}

✨A list is a data structure in Python that is a mutable, or changeable, ordered sequence of elements.

✨They are very similar to arrays. List can contain any type of variable, and they can contain as many variables as you wish. The list type implements the sequence protocol, and also allows you to add and remove objects from the sequence.

✨It is a mutable container. This means that we can add values, delete values, or modify existing values.

<b><marquee behavior= "alternate">PLEASE FOLLOW ME ✋</marquee>

Similar questions