Pythondex

Quiz

Lists & Tuples Quiz

Which of the following is a correct way to create a tuple?

fruits = ['apple', 'banana']
fruits = ('apple', 'banana')
fruits = { 'apple', 'banana' }
fruits = 'apple', 'banana'

What will the following code print?

2
3
4
Error

Which statement about tuples is TRUE?

Tuples are mutable
Tuples are immutable
Tuples can have items removed
Tuples are unordered

What will the following code output?

('apple', 'banana')
('cherry', 'apple', 'banana')
('apple', 'banana', 'cherry')
Error