wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Python Plus : Rock, Paper, Scissors

Total questions: 10

Worksheet time: 5mins

Name
Class
Date
1.
How do you get input from the user in Python?
a)
input()
b)
raw_input()
c)
get()
d)
receive()
e)
ask()
2.
What function is used to print text to the console?
a)
print()
b)
echo()
c)
write()
d)
console()
e)
display()
3.
How do you declare a variable in Python?
a)
var name = "value"
b)
name := "value"
c)
name = "value"
d)
let name = "value"
e)
set name = "value"
4.
What is the correct syntax for an if statement in Python?
a)
if x = 5:
b)
if x == 5 then:
c)
if (x == 5):
d)
if x == 5:
e)
if x = 5 then:
5.
How do you check multiple conditions in Python?
a)
if-else
b)
switch-case
c)
elif
d)
case
e)
while
6.
Which of the following is the correct syntax for an else statement?
a)
else
b)
otherwise
c)
elif
d)
default
e)
end
7.
What does elif stand for in Python?
a)
else if
b)
else
c)
if else
d)
elseif
e)
end if
8.
How do you compare two variables for equality in Python?
a)
a = b
b)
a == b
c)
a === b
d)
a equal b
e)
a := b
9.
What will print("Rock") output?
a)
Rock
b)
"Rock"
c)
print Rock
d)
print("Rock")
e)
None of these
10.
Which function is used to generate a random choice in Python?
a)
random()
b)
choice()
c)
randint()
d)
random.choice()
e)
random.randint()