PCEP Practice Exam 5

Quiz
•
Religious Studies
•
10th Grade
•
Medium
Henry Vo
Used 16+ times
FREE Resource
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.
Create a free account and access millions of resources
Similar Resources on Wayground
30 questions
The Mass through the Liturgy of the Word

Quiz
•
9th - 12th Grade
30 questions
SUDAI Knowledge

Quiz
•
6th Grade - Professio...
27 questions
Christology Chapter 5 Test Review

Quiz
•
9th - 12th Grade
25 questions
GLobal Politics IR

Quiz
•
10th - 11th Grade
25 questions
10A Fall 2023 Semester Review

Quiz
•
9th - 12th Grade
25 questions
Jubilee Year 2025

Quiz
•
9th - 12th Grade
25 questions
Bible hunt quiz

Quiz
•
9th - 12th Grade
26 questions
Quiz 05 | Arakaanul Islam| Wudu | Salah

Quiz
•
9th - 12th Grade
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
20 questions
US Constitution Quiz

Quiz
•
11th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Religious Studies
10 questions
Video Games

Quiz
•
6th - 12th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
UPDATED FOREST Kindness 9-22

Lesson
•
9th - 12th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
6 questions
Rule of Law

Quiz
•
6th - 12th Grade
15 questions
ACT Math Practice Test

Quiz
•
9th - 12th Grade
18 questions
Hispanic Heritage Month

Quiz
•
KG - 12th Grade
10 questions
Would you rather...

Quiz
•
KG - University