ProgrammingEasyTCS NQT · Wipro pattern
Which of these built-in Python types is immutable?
- A. dict
- B. tuple
- C. list
- D. set
Correct answer: B. tuple
A tuple cannot be changed after it is created. list, dict and set all support in-place changes (append, item assignment, add).
More Python Programming questions
- What is printed? python s = "placement" print(s[2:5])
- What is printed? python print(len({1, 2, 2, 3, 3, 3}))
- Which keyword turns an ordinary Python function into a generator function?
- What is printed? python x = [1, 2, 3] x.append([4, 5]) print(len(x))
- What is printed? python print(2 3 2)
- What is printed? python print(-7 // 2, -7 % 2)