Font size
WorksheetsPython_quiz_snakegame
Total questions: 10
Worksheet time: 6mins
The onkey() function calls the respective functions when the specific keys are pressed.
True
False
Look at the towers shown
A tower is "perfectly placed" if all the towers to the left of it are shorter, and all towers to its right are taller.
A
B
C
F
E
The listen() function is used to detect when the user has hit certain keys on the keyboard or moved/clicked the mouse.
True
False
In which direction is the turtle pointed by default?
East
West
North
South
What are the items you can specify when creating a function?
function name
parameter list
import
What is the output of the following code snippet?
def printfunc(msg, num = 1):
printfunc(msg * num)
func('Hello')
func('Students', 3)
Hello
Students
Hello
StudentsStudentsStudents
Hello
Students,Students,Students
Hello
Bowe the beaver wants to go home.Normally he follows the signs, but a strong wind has blown 3 of them away.
To get him home, each of the three new blue signs given below need to be put in correct places marked 1,2,3.
Which of the options below is the correct one?
What is the output of the following code snippet?
def myfunct(msg, num):
while num > 0:
print(msg)
num = num - 1
myfunct('Python', 4)
PythonPythonPythonPythonPythonPython
PythonPythonPythonPython
invalid call
infinite loop
What is the output of the following code?
def outerFun(a, b):
def innerFun(c, d):
return c + d
return innerFun(a, b)
res = outerFun(5, 10)
print(res)
15
Error
5
10
Little Flora wants to pick flowers for her grandmother.
Her garden is divided into several flower beds.
Each flower bed has a certain number of flowers.
Little Flora starts picking flowers from the top left flower bed and makes her way down to the bottom right flower bed.
She can decide to walk downwards (↓) or to the right (→) but in no other direction.
Which of the flower beds on her path will help her collect the most flowers.
