Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in Python by (55.6k points)

A. list

B. set

C. tuple

D. dict

1 Answer

0 votes
by (119k points)

The answer is option C (Tuple). The tuple is immutable i.e we can change the elements, delete the existing elements, and cannot add new elements. Here is an example of what will happen if you try to reassign an element in tuple:

a = (1, 2, 3, 4)

a[0] = 1

On running the above code, you will get an error message “TypeError: 'tuple' object does not support item assignment”.

The datatypes like int, float, bool, str, tuple, and Unicode are immutable. Datatypes like list, set, dict are mutable.

I recommend checking out this Python Tutorial by Intellipaat to learn more about Datatypes in Python.

Also, watch this video on Python data types:

Interested to learn more about Python? Come & join our Python course

Related questions

–1 vote
3 answers
0 votes
1 answer
asked Jun 17, 2020 in Python by Sudhir_1997 (55.6k points)
0 votes
1 answer
asked May 30, 2020 in Python by Sudhir_1997 (55.6k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...