WorksheetsPython Code 3- PLTW AC
Total questions: 25
Worksheet time: 20mins
Match the definition with the word.
capture
social
science
study
iteration
meaning
imagine
prepare
create
assess
>=
<=
This operator means that one value is the greater than or equal to the other value.
>=
<=
This operator means that one value is the less than or equal to the other value.
>=
<=
Boolean data is either (a) if it is correct or (b) if it is incorrect. The first letter (c) be capitalized.
Boolean values are (a) strings.
That is, they are not enclosed by (b) marks.
A while loop can be used in which of the following situations?
Repeat a set of statements till a condition remains True.
Repeat a set of statements a finite or an infinite number of times.
Iterate through a string, list, and tuple.
All of the above
What will be the output?
name = "Sailor"
print (name)
name
Dave
sailor
Sailor
A syntax error means your code has a 'grammar' mistake or you used symbols/operations incorrectly
True
False
Which statement correctly assigns the string "Tanner" to the variable name?
name = print( "Tanner")
input("Tanner")
name= "Tanner"
name = input("Tanner")
Which statement correctly assigns the string "Kimbrough" to the variable name?
name = print( "Kimbrough")
input("Kimbrough")
name= "Kimbrough"
name = input("Kimbrough")
What is the output from the following code?
print ("hello world")
hello world
Hello world!
Hello World
"HELLO WORLD"
What will be the output?
name = "Dave"
print ("name")
Dave
name
"name"
"Dave"
Loop that runs as long as the condition is true
list
while
for
if
In Python, the two types of loops are _____ and _______
while
for
list
if
loop
What symbol do you use to make a comment in Python?
+
//
$
#
Label the parts of the code.
false
true
loop
keyword
condition
repeating
Write a loop that collects all of the coins.
move down
move right
move down
move right
while true loop
move down
move right
while there are coins
move down
move right
move down(2)
move right(2)
What is a control structure?
boolean control structure
object in a method call statement
makes the ball hop up and down stairs
coding that allow you to specify the flow of execution in your code
Which psudocode is not a loop?
while knowing is less than grade 12
keep learning
then graduate
while vegetables are present
keep eating
then burp
while gems are present
find gem
pick up gem
shout yay!
while true
keep breathing
sleep as long as I am tired
Which psudocode is an infinite loop?
while knowing is less than grade 12
keep learning
then graduate
while vegetables are present
keep eating
then burp
while gems are present
find gem
pick up gem
shout yay!
while true
keep breathing
sleep as long as I am tired
