NEW
Font size
WorksheetsText, Math and Loops
Total questions: 15
Worksheet time: 8mins
Which of these lines will get Python to display the message Hello World! on the screen?
print("Hello World!")
print(Hello World!)
print"Hello World!"
print=("Hello World!")
What does \n do in Python?
It allows us to display the letter n in a print statement
It means "not equal to"
Divide by n
Moves to the next line
In Python, what is 2 * 8
2
4
8
16
In Python, what is 20 / 8?
2
2.5
3
4
In Python, what is 20 // 8?
2
2.5
3
4
In Python, what is 20 % 8?
2
4
8
16
What is a string in Python?
A number with a decimal point
A variable
A number without a decimal point
A snippet of text
What do we call numbers with decimal points in Python?
Integers
Fractions
Variables
Floats
Which of the below options is the correct way to type in a string in Python?
"I'm the one"
(it's me)
this one
("correct")
Which of the below options is false when it comes to variables?
Variable values can be changed once they have been set
Variables are stored in the computer's memory
Variables have names and values
Variable names can be changed once they have been created
What does a while loop do?
It keeps repeating a piece of code forever
It keeps repeating a piece of code until it reaches a pre-set amount of rounds
It keeps repeating a piece of code until a certain condition is met
It keeps repeating a piece of code for a while
Which of the below symbols does a while loop need in order to function properly in Python?
=
:
==
<
Which symbol does a variable need in order to function properly in Python?
=
:
==
<
What does =! mean in Python?
Nothing
Never
None of the other answers
Not equal to
Which of the below while loops will be correctly understood by Python?
while mrTolak = happy:
while "mrTolak" == "happy"
while "mrTolak" = "happy":
while mrTolak == "happy":
