PCEP Practice Exam 5
Quiz
•
Religious Studies
•
10th Grade
•
Practice Problem
•
Medium
Henry Vo
Used 16+ times
FREE Resource
Enhance your content in a minute
30 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following statements is incorrect:
An indentation in Python language is mandatory
The '#' is used as single line comments and the """ """ (triple quote) is used as multi-line comments
We don't need to declare the type of a variable in Python program
All of these are correct.
Answer explanation
Python is indentation-strict language. We can use # for single line comments or triple quotes for multiple-line comments (usually called DocStrings). Python is a dynamically typed language so we don't need to declare the variable data type.
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will the output be when the following code is executed?
"Robert, 123455667, Dar es salaam "
Robert 123455667 Dar es salaam
SyntaxError
Robert' 123455667 'Dar es salaam '
Answer explanation
Multiple variables can be assigned values as shown in the example above. Keep in mind that we must have the same number of variables and values, otherwise we will get one of the following errors depending on the situation: TypeError: cannot unpack non-iterable int object if the number of values on the right side is less than the number of variables on the left side. ValueError: too many values to unpack if the number of values on the right side is larger than the number of variables on the left side.
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output when the following code is executed?
\n:\n:\n
:
:
:
Three blank lines
error
Answer explanation
The end = "\n\n\n" will append three newline characters (\n) after printing out the text. Since there are no objects provided to the print() function to be printed, only the three empty lines will be printed. The sep is redundant in this code as there is no text to be printed.
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output when the following code is executed?
25
256
error
25.6
Answer explanation
The int function will round down to the previous whole number, in this case 25.
5.
MULTIPLE SELECT QUESTION
45 sec • 1 pt
Which of the following statements is incorrect (select all that apply):
The bool("123") will return True
The bool("") will return True
The bool({}) will return False
The bool(-1) will return False
Answer explanation
The bool function when provided an empty string, empty object, or zero, will return False. In any other case, it will return True. bool("") evaluates to False as it is an empty string and the bool(-1) evaluates True as -1 is a non-zero value.
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What would be the output of the following code:
1
2
4
25
Answer explanation
The exponentiation will take precedence over modulo, hence the above expression can be simplified to 2 % 25 . The remainder of the division of 25 by 2 is 2.
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output when the following code is executed?
False
True
SyntaxError
error
Answer explanation
The if condition will evaluate to False as since p is not less than 10, q is not greater than 20 and r is not greater than 30. Hence the else block will get executed. Note: In this example, all of the conditions in the if statement evaluate to False. However in another scenario, even if only one of them is False, the if block would not get executed.
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 Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
25 questions
New Testament Intro
Quiz
•
9th Grade - University
25 questions
Lesson 14-17
Quiz
•
10th Grade
27 questions
V - Christian Beliefs
Quiz
•
10th - 11th Grade
25 questions
Lightbearers: Unit 9- Economics & Personal Peace and Affluence
Quiz
•
9th - 12th Grade
25 questions
Memory Verse Practice #7
Quiz
•
9th - 12th Grade
25 questions
The Almighty God
Quiz
•
10th Grade
27 questions
Eddsworld
Quiz
•
KG - Professional Dev...
34 questions
Medieval Middle East
Quiz
•
5th - 12th Grade
Popular Resources on Wayground
15 questions
Fractions on a Number Line
Quiz
•
3rd Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
54 questions
Analyzing Line Graphs & Tables
Quiz
•
4th Grade
22 questions
fractions
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
15 questions
Equivalent Fractions
Quiz
•
4th Grade
Discover more resources for Religious Studies
20 questions
-AR -ER -IR present tense
Quiz
•
10th - 12th Grade
10 questions
Understanding Meiosis
Interactive video
•
6th - 10th Grade
15 questions
Making Inferences
Quiz
•
7th - 12th Grade
18 questions
SAT Prep: Ratios, Proportions, & Percents
Quiz
•
9th - 10th Grade
15 questions
Main Idea and Supporting Details.
Quiz
•
4th - 11th Grade
12 questions
Parallel Lines Cut by a Transversal
Quiz
•
10th Grade
12 questions
Add and Subtract Polynomials
Quiz
•
9th - 12th Grade
7 questions
How James Brown Invented Funk
Interactive video
•
10th Grade - University
