Python Test 25 List Tuple Dictionary

Python Test 25 List Tuple Dictionary

Professional Development

70 Qs

quiz-placeholder

Similar activities

Skill Test Computers Round-1

Skill Test Computers Round-1

Professional Development

75 Qs

Tin học nâng cao Module 09.1 - Trung Đức Nguyễn

Tin học nâng cao Module 09.1 - Trung Đức Nguyễn

Professional Development

75 Qs

Python Programming

Python Programming

Professional Development

75 Qs

Java String-2

Java String-2

Professional Development

67 Qs

Object oriented Programming

Object oriented Programming

Professional Development

70 Qs

Servlets, JSP & XML

Servlets, JSP & XML

Professional Development

70 Qs

Try Catch + java-visual

Try Catch + java-visual

Professional Development

74 Qs

C programming

C programming

University - Professional Development

65 Qs

Python Test 25 List Tuple Dictionary

Python Test 25 List Tuple Dictionary

Assessment

Quiz

Computers

Professional Development

Hard

Created by

ram lovewanshi

Used 40+ times

FREE Resource

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?

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]

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?