WorksheetsPage 1
Total questions: 14
Worksheet time: 7mins
Which function is used to display text on the screen?
input()
show()
print()
display()
What does the input() function wait for the user to do?
Click the mouse
Press Enter
Turn off the computer
Type a number only
True or False: Python function names like print and input must always be written in lowercase.
True
False
According to the "Rules for Naming," which variable name is valid?
first name
first_name
"first_name"
1stname
What data type does the input() function always return?
String
Integer
Boolean
Float
Which symbol is the "Assignment Operator" used to store a value in a variable?
==
:
=
%
Topic 3: Logic & Selection (If/Else). Which keyword handles the "Plan B" (runs only if all other conditions are false)?
if
elif
else
then
Topic 3: Logic & Selection (If/Else). What character must appear at the end of an if or else line?
; (semicolon)
. (period)
: (colon)
What does the % operator do in Python?
Calculates percentage
Divides two numbers
Finds the remainder (Modulus)
Multiplies two numbers
Which operator checks if two values are equal?
=
==
!=
<>
In the expression length = length + 5, what happens to the variable?
It stays the same
It is reset to 5
It increases by 5
It becomes a string
Which library would you import to generate random numbers for a game?
math
turtle
How many times will for i in range(4): repeat the code block?
3 times
4 times
5 times
0 times
To use a library like turtle, what command must you use first?
get turtle
start turtle
import turtle
open turtle
