Python Quiz SE 27/10/2023

Quiz
•
Other
•
University
•
Hard
Adi Adi
Used 2+ times
FREE Resource
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
Similar Resources on Wayground
30 questions
Python Programming Quiz

Quiz
•
University
28 questions
ITP221-LONG QUIZ

Quiz
•
University
25 questions
FUNCTIONS OF LAYERS & DATA LINK LAYER

Quiz
•
University
25 questions
Inter School Quiz (English Medium) Paper 05

Quiz
•
University
25 questions
Image Analysis 1B Class 9: Bootcamp Review

Quiz
•
University
25 questions
Data collection and sampling quiz

Quiz
•
University - Professi...
22 questions
ICT Final Exam 2021

Quiz
•
University
21 questions
OSI Models

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Other
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University