WorksheetsPython Programming Quiz
Total questions: 20
Worksheet time: 18mins
Can a number be a string? True or False.
True
False
_______ is the process of reducing complexity by hiding unnecessary information and focusing on what is needed to make it work.
Loop
Formality
Abstraction
Function
What does the % operator do in Python?
Calculates the leftovers
Calculates the dividend
Calculates the product
Calculates the remainder
What will be the output of print("hello" + 1 + 2 + 3)?
Error
hello123
hello6
"hello"123
Which of the following checks if x is equal to y?
if x = y:
if x == y:
if x != y:
if x >= y:
Which command will correctly ask the user for their age and save it as an integer?
age = input("What is your age?")
age = int(input("What is your age?"))
age = float(input("What is your age?"))
age = int(input("What is your age?"))
Which of the following checks if x is not equal to y?
if x not = y:
if x == y:
if x =! y:
if x != y:
___________ is a collection of Python code that is developed to add functionality to a program.
module
parameter
variable
chain
What is the result of 22 % 3?
0
1
2
3
Code to check if the variable x is less than 20.
if x <> 20:
if x <= 20:
if x <= 20
if x < 20:
What is the term for a collection of commands given a name, for example, input()?
Function
Module
Export
Import
A placeholder in computer memory that holds the input from a user.
variable
function
parameter
if-else
Which operator performs division, but returns the remainder?
%
\
/
//
Which operator performs an integer division?
#
%
//
*
Which operator performs multiplication?
#
%
//
*
Which operator performs exponentiation?
**
*
%
/
What does the symbol '#' do?
Adds a comment
Divides
Calculates the remainder
Multiplies
Which keyword pulls in modules to add functions to your code?
export
import
variable
function
Takes the square root of x and returns a float.
math.random(x)
import.math(x)
sqrt.math(x)
math.sqrt(x)
A ____________ is used to pass information to a function.
module
parameter
variable
x
