Font size
WorksheetsOzaria Python Code Practice Quiz
Total questions: 75
Worksheet time: 44mins
What is the purpose of using variables in Python?
To store and manipulate data
To confuse the programmer
To slow down the program
To make the code longer
What is the output of the following code snippet? x = 5 if x > 3: print('x is greater than 3') else: print('x is less than or equal to 3')
x is equal to 3
x is less than 3
x is greater than 3
x is greater than or equal to 3
What is the purpose of using a function in Python?
To encapsulate a set of instructions that can be reused and called multiple times within a program.
To confuse other programmers
To slow down the program execution
To make the code longer and more complicated
What is the output of the following code snippet? try: x = 10 / 0 except ZeroDivisionError: print('Cannot divide by zero')
The result is 0
Error: Division by zero
Division by zero is not allowed
Cannot divide by zero
What is the correct way to write an if statement that checks if a variable 'age' is greater than 18 in Python?
if age >= 18:
if age > 18:
if age == 18:
if age < 18:
What will be the output?
name = "Dave"
print (name)
Dave
'Dave'
name
(name)
What is Algorithm?
Fixing bugs
Functions
A sequence of instructions
Game design
Fixing errors in programming is called ...
Optimization
Debugging
Looping
Cleaning
A command that lets us repeat an action multiple times in your code
Algorithm
Loop
Variable
Method
Which line of code is used to make a loop?
for i in range(5)
# Code normally executes in the order it's written.
hero.build("upArrow")
a = "door"
Find the object in the following code:
helper.build("upArrow")
helper
build()
upArrow
hero
Find the argument in the following code:
hero.moveUp(4)
hero
moveUp()
4
Up()
Find the method in the following code:
hero.use("door")
hero
use()
door
" "
Which python operator means 'less than or equal to'?
>=
>
<
<=
Python uses indentation to block code into chunks
True
False
What is the term for a set of rules for how things are spelled and formatted in code so the computer can understand it?
debugging
syntax
loop
decoding
What is a loop in programming?
a syntax that directs a program to repeat over and over again until a specific number is reached
a syntax that directs a program to skip over a specific piece of code
a syntax that directs a program wait until a condition is met for a specific subset to be activated
the best type of cereal when it is flavored with fruit and sold by a toucan
How can you format programming text to show it is part of a loop in Python?
bold
italicize
indent
circle
What are Strings?
a type of data that represents text. In both Python and JavaScript, strings are represented by text inside quotes.
A character or thing that can perform actions.
the rules for correct spelling, grammar, and punctuation in a programming language.
An action performed by an object.
What is an Object?
A character or thing that can perform actions.
Data about or belonging to an object.
A programming structure used to repeat actions without the player needing to write the same lines of code over and over.
a type of data that represents text.
What do For Loops do?
A programming structure used to repeat actions without the player needing to write the same lines of code over and over.
Data about or belonging to an object.
Repeat a block of code while a certain condition is true.
Repeat a block of code a certain number of times.
What do While Loops do?
A programming structure used to repeat actions without the player needing to write the same lines of code over and over.
Repeat a block of code a certain number of times.
Repeat a block of code while a certain condition is true.
An action performed by an object.
write code to build their own apps and games
Developers
Sequence
Code
the order in which the command are given.
Code
Commands
Sequence
an error in your code
Bug
Debugging
Sequence
Determine the next line of code:
hero.moveRight(2)
hero.moveUp()
hero.say("open sesame")
hero.moveUp()
hero.use("door")
hero.jumpUp()
The following 10 lines of code can be shortened to...
hero.moveDown()
hero.moveRight()
hero.moveRight()
hero.moveDown()
hero.moveUp()
hero.moveUp()
hero.moveLeft()
hero.moveDown()
hero.moveLeft()
hero.moveLeft()
7 lines
5 lines
6 liens
impossible to condense
What language will you use to talk to the Acodus?
Programming
English
Computer
None of the above
Which of these is a method?
use
hi
Vega
Mouse
Which of these is an appropriate comment for a subgoal in this scenario?*
#sneak across the traps
#sneak through the grass
jump through the grass
#use jump on the traps
Which is not an appropriate subgoal for this level?
#jump across the river and pits
#sneak through the grasses
move across the grass slowly
#get passed the enemy by not being detected
What is the type of error(s), and error(s) are present in this code?
logic, not moving the right directions
logic, not enough moves in arguments
syntax and logic, missing a parenthesis and period
syntax and logic, object and a method is not typed correctly and missing parenthesis and period
syntax, misspelled words and objects
How many subgoals/comment codes should you have at minimum here?
1
2
3
4
What is the correct value of the variable "steps" that should be used in this scenario?
1
2
3
4
5
When a file is sent across networks, it is broken down and sent in smaller pieces, known as...
binary code
pixels
packets
images
The rules that allow different devices to communicate and share information is known as...
data
protocols
networks
HTTP
Which of the following best describes a network?
two or more computers that are connected with one another for the purpose of communicating electronically
an internet service provider
a method of transferring data using encoding schemes
none of the above
What is the least number of lines of code needed in order to reach the red flag?
1
2
3
4
Which code doesn't exist in Ozaria?
hero.build("rightArrow")
hero.jumpLeft()
hero.attack("Treg")
hero.moveDown()
How many lines of code have bugs?
hero.moveLeg()
hero,moveDown()
hero.move()
hero.use("door")
1
2
3
4
No errors
What is the minimum lines of code needed to collect all the gems?
3
4
6
10
for index in range(___):
helper.moveUp()
helper.moveLeft()
4
2
5
8
Is it possible to reach the lever using 3 lines of code only?
Yes
No
Find the argument in the following code:
hero.moveUp(4)
hero
moveUp()
4
Up()
Find the method in the following code:
hero.use("door")
hero
use()
door
" "
helper.moveDown(2)
helper.build("rightArrow")
helper.moveRight()
helper.build"downArrow"
Does this code above have an error(s)?
Yes
No
How many lines of code is needed to build a path to the crystal battery?
4
5
8
10
How many down arrows you should build in this task?
3
4
6
None of them
This term is used to describe code that tells the computer to perform a task if certain actions are possible or not.
debugging
conditional
variable
cheetos
telling a computer what to do.
Command
Code
Developers
A sequence of instructions that can be used to solve a problem or set of problems
Algorithm
Condition
Syntax
a command that lets us repeat an action multiple times in your code
Decomposition
Coding
Loop
a set of rules for how things are spelled and formatted in code so that the computer can understand it
Syntax
Sequence
Loop
What is a logical error?
the wrong direction or human error
a misspelling or wrong format of the code
the code doesn't work
Code Bank
a method that changes the look of your player
a method that changes the look of your background
A play to find more information about the different method and tools you can use while you code.
a method that changes the size of your games map
Helper.setBackgroud(“crystal”):
a method that changes the look of your player
a method that changes the look of your background
A play to find more information about the different method and tools you can use while you code.
a method that changes the size of your games map
helper.setPlayer(“turtle”)
a method that changes the look of your player
a method that changes the look of your background
A play to find more information about the different method and tools you can use while you code.
a method that changes the size of your games map
helper.setMapSize(“small”)
a method that changes the look of your player
a method that changes the look of your background
A play to find more information about the different method and tools you can use while you code.
a method that changes the size of your games map
Assigns IP addresses to user devices as they access the network
SMTP
DHCP
DNS
HTTPS
We can reassign variable values by retyping the variable name and setting it equal to another value. This value in this example is called a...
name
integer
number
string
In conditionals we use comparators, which of these is NOT a valid comparator we use?
=
>=
<
*
Which method is going to be important to use for this level?
hero.sneak()
getDistanceTo(enemy)
hero.UseEarthPit(enemy)
hero.jumpRight()
You would use castEarthPit(enemy) on an enemy that is...
< 3 distance
=2 distance
>2 distance
< 5 distance
Which of these is not an input device in a computing system
monitor
keyboard
mouse
microphone
To properly exit a loop, you must...
type "end.loop"
indent the line of code again
unindent the next line of code
hit enter twice
a for loop will end when...
a certain condition is met
the argument value has been met
the character is on a specific marker location
the hero moves up
A loop inside of another loop is referred to as...
compound loop
loopdy loop
quantum loop
a nested loop
pseudocode is the process of...
writing your first draft of code and checking for bugs
writing out your code in plain text to plan it out
writing your code out after you've checked it for errors
writing out the opposite code
Using the Caesar Cipher method, decode this: ghexj
mouse
modem
apple
debug
