
Python Practice
Authored by Knight Brandon
Computers
12th Grade
Used 2+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? for i in range(5): print(i)
0 1 2 3 4
0 1 2 3 6
1 2 3 4 5
0 1 2 3 5
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? for i in range(1, 6): if i % 2 == 0: print(i)
1
3
5
2 4
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is a valid data type in Python?
int, float, str, bool, list, tuple, set, dict
int, float, str, bool, list, tuple, set, dict, array
int, float, str, bool, list, tuple, set, dict, boolean
int, float, str, bool, list, tuple, set, dict, string
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? x = 'Hello' print(x[1:3])
el
He
el
lo
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? x = 'Hello' print(x[-1])
H
e
o
l
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? x = 'Hello' print(x.upper())
HELLO
helloo
hello
HELLO
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code? x = 'Hello' print(x.replace('l', 'L'))
HeLLo
HeLlO
HeLLO
HeLOo
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Microsoft
or continue with
%20(1).png)
Apple
Others
Already have an account?