Search Header Logo

Python Test 25 List Tuple Dictionary

Authored by ram lovewanshi

Computers

Professional Development

Used 44+ times

Python Test 25 List Tuple Dictionary
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

70 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following creates a tuple?

tuple1=("a","b")

tuple1[2]=("a","b")

tuple1=(5)*2

None of the above

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Choose the correct option with respect to Python.

Both tuples and lists are immutable.

Tuples are immutable while lists are mutable.

Both tuples and lists are mutable.

Tuples are mutable while lists are immutable.

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

colors = ["red", "green", "burnt sienna", "blue"]

print(colors[2])


What is the output of the above python code?

'blue'

It causes a run-time error.

'burnt sienna'

'green'

4.

FILL IN THE BLANK QUESTION

1 min • 1 pt

colors = ["red", "green", "burnt sienna", "blue"]


Which list index would select the value 'red' from the above list?

(a)  

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

colors = ("red", "green", "burnt sienna", "blue")


print("yellow" in colors)


What is the result of the yellow in colors expression?

ValueError: 'yellow' is not in list

4

False

True

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What’s the main difference between Python lists and tuples?

Lists can hold any data type and tuples can only contain int and str objects.

Lists are immutable and tuples are mutable.

Lists are mutable and tuples are immutable.

Lists are faster and tuples are slower.

Check Your Answer »

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output?

var1=['sam', "Pam", 12,44]

var1[3]="Ram"

print(var1)

['sam', 'Pam', 12, 44]

['sam', 'Pam', 12, 'Ram']

It will give an error

['sam', 'Pam', 'Ram',44]

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?