Python Quiz SE 27/10/2023

Python Quiz SE 27/10/2023

University

26 Qs

quiz-placeholder

Similar activities

Democracy and the United Kingdom

Democracy and the United Kingdom

12th Grade - University

24 Qs

Tema 3 y 4. Método Razones Financieras y Método de reducción a %

Tema 3 y 4. Método Razones Financieras y Método de reducción a %

University

21 Qs

2D/8R/S

2D/8R/S

University - Professional Development

22 Qs

Persiapan ASAS

Persiapan ASAS

11th Grade - University

22 Qs

Greek Roots Practice

Greek Roots Practice

KG - University

22 Qs

ALS

ALS

University - Professional Development

21 Qs

MIK 6 (RKE/RME)

MIK 6 (RKE/RME)

University

21 Qs

Python Quiz SE 27/10/2023

Python Quiz SE 27/10/2023

Assessment

Quiz

Other

University

Practice Problem

Hard

Created by

Adi Adi

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...

26 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which statement is used to exit a loop prematurely in Python?

next

break

stop

end

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the base class in Python?

The class that is derived from other classes

The class with the lowest hierarchy in a class hierarchy

The class that inherits from multiple classes

The class that serves as the foundation for other classes

3.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

In Python, which function is used to convert a string to lowercase?

lower()

LowerCase()

convertToLower()

toLower()

4.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

Which of the following is not a valid way to open a file in Python?

file = open('data.txt', 'a')

file = open('data.txt', 'w')

file = open('data.txt', 'r')

file = open('data.txt', 'x')

5.

MULTIPLE CHOICE QUESTION

45 sec • 1 pt

What is the Big O time complexity of searching for an element in an unsorted list in Python using a for loop?

O(1)

O(n)

O(log n)

O(n^2)

6.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

What is the output of the following Python code?

x = [1, 2, 3]

y = x

y[0] = 4

print(x)

[1, 2, 3]

[1, 4, 3]

[4, 4, 3]

[4, 2, 3]

7.

MULTIPLE CHOICE QUESTION

1 min • 2 pts

What is the output of the following Python code?

x = "Hello, World!"

result = x[::-1]

print(result)

"Hello, World!"

"olleH ,!dlroW"

"!dlroW ,olleH"

"World!, Hello"

Create a free account and access millions of resources

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

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?