Python Quiz

Python Quiz

University

20 Qs

quiz-placeholder

Similar activities

Week 4

Week 4

University

15 Qs

Java Control and Loop -2

Java Control and Loop -2

University

20 Qs

Lenguaje de Definición de Datos

Lenguaje de Definición de Datos

University

18 Qs

Intro to Data Mining

Intro to Data Mining

University

15 Qs

Firewall and Network Security

Firewall and Network Security

University

15 Qs

PBO Inheritance Episode 2

PBO Inheritance Episode 2

University

18 Qs

Logika & Pemrograman (ID)

Logika & Pemrograman (ID)

10th Grade - Professional Development

20 Qs

2.4 - 2.6

2.4 - 2.6

University

15 Qs

Python Quiz

Python Quiz

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

Sumit Kumar

Used 2+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the output be of ((500//7) % 5) ** 3?

1

2.91

0

8

71.42

2.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

How will you extract ‘love’ from the string S = “I love Python”? (More than one option may be correct.).


S[2:5]

S[2:6]

S[3:7]


S[-11:-7]

S[-11:-8]

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If you have a list L = [1, 2, 3], what will the output of L * 2 be?

[2, 4, 6]

[1, 2, 3, 1, 2, 3]

[1, 4, 9]

[[1, 2, 3], [1, 2, 3]]

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If you have a list L = [[1, 2, 3], [4, 5, 6], [7, 8, 9, 10]], what will the output of L[2: ] be?

[[7, 8, 9, 10]]

[7, 8, 9, 10]

[3, 4, 5, 6, 7, 8, 9, 10]

[[3], [4, 5, 6], [7, 8, 9, 10]]

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If you have a tuple T = (3, 5, 7, 11), what will the output of T.append(9) be?

(3, 5, 7, 9, 11)

(3, 5, 7, 11, 9)

(9, 3, 5, 7, 11)

Error

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the output be of the following code?

D = {1:['Raj', 22], 2:['Simran', 21], 3:['Rahul', 40]}

for val in D:

print(val)


1
2
3

[‘Raj’, 22]
[‘Simran’, 21]
[‘Rahul’, 40]

1 [‘Raj’, 22]
2 [‘Simran’, 21]
3 [‘Rahul’, 40]


‘Raj’
‘Simran’
‘Rahul’

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the ‘comprehension equivalent’ be for the following snippet of code?

for sentence in paragraph:

for word in sentence.split():

single_word_list.append(word)

word for sentence in paragraph for word in sentence.split()


[word for sentence in paragraph for word in sentence.split()]

word for word in sentence.split() for sentence in paragraph

[word for word in sentence.split() for sentence in paragraph]

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?

Discover more resources for Computers