Font size
WorksheetsPython 1 Review Game
Total questions: 73
Worksheet time: 46mins
Kyle is setting up a script on his new laptop to display a personalized message when he starts his terminal. Which command should he use to output 'Welcome, Kyle!' to the screen?
echo 'Welcome, Kyle!'
print 'Welcome, Kyle!'
say 'Welcome, Kyle!'
greet 'Welcome, Kyle!'
Aditya and Sophie are working on a Python project for their school. They need to display their team name, 'CodeCrushers', on the screen. Which Python command should they use?
@echo off
print("CodeCrushers")
print 'CodeCrushers'
echo CodeCrushers
In Python, when Kyle is writing a script to automate his social media posts, a variable needs to
start with a lower case letter
be stated before "print"
have % symbols on either side
Variable????? We don't need variables!!!!
When Nila types her report on the computer for her science project, the text she enters is considered
input
output
storage
process
Sofia is working on her laptop. When she finishes designing a presentation and projects it onto a screen, this is known as
input
output
storage
processing
When Sarthak uses his laptop to calculate the total cost of the groceries he bought last week, the laptop's action of adding up the prices is known as
input
output
processing
storage
Sofia is working on a Python project for her computer science class and needs to print a welcome message for users of her program. Which of the following Python commands should she use to output the message 'Welcome to the program!' on the screen?
print('Welcome to the program!')
echo 'Welcome to the program!'
output 'Welcome to the program!'
say 'Welcome to the program!'
Aditya and Sofia are working on a Python project for their coding class. They want to add some notes in their code for future reference, but they don't want these notes to interfere with the execution of their code. Which symbol should they use to achieve this?
rem
#
IGNORE!
( )
Aneesh and Sophie are competing in a coding challenge. Aneesh is writing a function to determine if their scores are different. Which Boolean operator represents "not equal to" in most programming languages?
XX
!=
<>
_
Sofia is developing a Python program for her school project. The program should alert her when the temperature in her greenhouse reaches exactly 10 degrees. Which line of code should she use in her program?
if temperature=10:
if temperature==10:
if temperature==10;
if temperature="10";
Lakshan is working on a Python project and comes across a situation where he needs to write an if/else statement. After typing the condition and hitting enter, he ponders whether he should always press the tab key to indent the next line of code.
Yes, always indent the line after the condition
No, never indent the line after the condition
Only capitalize every word instead
Just put a colon at the beginning and the end
Sophie, Aiden, and Nila are participating in a coding competition. They are tasked with writing a Python code snippet that prints a special message when a certain condition is met. Which code should they submit to succeed in their task?
if secret_number==42:
print("You have discovered the secret!")
if secret_number==42...
print("You have discovered the secret!")
if secret_number==42:
print "You have discovered the secret!"
if secret_number==42:
print( You have discovered the secret!)
Nila, Tyler, and Lakshan are participating in a robotics competition. To program their robot to navigate through a maze, which Python command should they focus on to implement repetitive movements?
loop
variable
function
a remote control
Hey there, coding enthusiasts! Rishab, Sofia, and Aiden are on a programming quest, and they've encountered a concept in Python. In Python, iteration refers to the process of:
executing a loop
declaring a variable
defining a function
issuing a command
Tyler is working on a computer program where he writes a loop with a condition that says 'true' to keep the program running. What happens in the program as long as Tyler keeps the loop condition as 'true'?
The program continues running and the loop repeats itself
The program immediately ends
The program resets and starts over
Aditya earns 10 points each time
Aiden, Sarthak, and Tyler are keeping track of their scores in a game of trivia. They have a scoreboard where each score is listed with an index number. In their scoreboard, which score has the index number of 3?
["Aiden", "Sarthak", "Tyler", "Aiden", "Sarthak", "Tyler"]
"Aiden"
"Sarthak"
"Tyler"
Imagine you're organizing a team for a school project and you have a list of student names. You need to confirm that your friend Sofia is listed second for the presentation order. The list looks like this:
studentList = ["Kyle", "Sofia", "Tyler", "Rudraksh", "Sophie", "Sofia"]
Which piece of code would correctly identify Sofia's position as the second presenter in the list?
studentList()
studentList[1]
studentList(4)
studentList["4"]
Aditya, Viraj, and Aiden are sharing their favorite football player's jersey numbers. If we record these jersey numbers in a list, what data type would that list be?
String
Boolean
Float
Integer
Viraj, Nila, and Zach are working on a computer science project about data structures. To complete their code, they need to know which symbols are used to open and close a list in many programming languages. Can you help them figure it out?
( ) round brackets
{ } curly brackets
[ ] square brackets
" " speech marks
Tyler, Aneesh, and Lakshan are arranging their music playlist. If they use playlist.sort(), what will happen to their playlist?
Sort the playlist into alphabetical order
Sort the playlist into reverse order
Create a new playlist
Error
Viraj has a playlist of his favorite songs in the order he listened to them: ['Bohemian Rhapsody', 'Imagine', 'Hotel California', 'Stairway to Heaven']. He uses a certain playlist function to rearrange this playlist so that the last song he listened to becomes the first one on the playlist. What is the function of this method?
It removes the first occurrence of the song inside the parenthesis from the playlist.
It adds the song inside the parenthesis to the end of the playlist.
It reverses the order of the songs inside the playlist.
It sorts the playlist of songs in alphabetical order.
Kyle is organizing a list of his project team members: teamList = ["Viraj", "Tyler", "Sarthak", "Viraj", "Rudraksh", "Kyle"]
He noticed that 'Viraj' is listed twice and decides to remove the duplicate entry using the command: del teamList[3]
After executing this command, what would the team list look like?
['Viraj', 'Tyler', 'Sarthak', 'Rudraksh', 'Kyle']
['Viraj', 'Tyler', 'Sarthak', 'Viraj', 'Kyle']
['Viraj', 'Tyler', 'Viraj', 'Rudraksh', 'Kyle']
Error
In a Python programming workshop, the instructor is explaining variable assignment using participants' names. What will be the output of the following code snippet?
participant_name = "Sofia"
print(participant_name)
Sofia
'Sofia'
participant_name
(participant_name)
Sophie is developing a Python script for a school project that prompts users to enter their favorite book. Which Python command should she use to capture the user's input?
answer()
open()
print()
input()
Sofia is developing an application for her school's science fair to calculate the circumference of a circle. She decides to use a constant PI with a value of 3.14. Which data type is most appropriate for Sofia to use for the constant PI?
STRING
INTEGER
FLOAT
BOOLEAN
Lakshan is setting up a database for a car rental service and needs to store vehicle plate numbers. One of the plate numbers is: plateNumber = "RENT-123". What data type should be used to store this plate number in the database?
STRING
INTEGER
FLOAT
DATE
A circle drawn by Sophie is the same as a Circle drawn by Zach.
True
False
Cassandra is working on a Python script for her science project to display the temperature readings on the screen. Which function should she use to show the message?
sum
import
display
Rishab and Sophie are working on a project to create a website. They need to display a welcome message on their website. They need three of these items to correctly format the string in their code. Which of the following do they need? (Select two options that apply)
backslashes
quotation marks
apostrophes
parentheses
In a software development workshop, Rishab is collaborating with Cassandra on a project involving various programming symbols. Rishab encounters the * symbol in a piece of code and turns to Cassandra for clarification. What is the correct name for the * symbol?
hashtag
star
loop
asterisk
Rudraksh is working on a Python project for his computer science class, and he uses hashtags in his code. What purpose do these hashtags serve?
They highlight the text in yellow
They make the text blink
They comment out parts of the code
They underline the text
Kyle, Viraj, and Nila are discussing about Python programming. Kyle says int() is used for 'internet', Viraj thinks it's for 'input', and Nila insists it's for 'integer'. Who is correct?
Kyle
Viraj
Nila
None of them
Tyler, Sofia, and Rudraksh are at a cafe splitting the bill and notice an amount that isn't whole and has a point in it. What do they call this type of number?
decimal number
whole number
half a number
a fraction
Zach, Cassandra, and Sophie are playing a board game. They landed on a space that reads 'Solve the riddle to advance: Identify the integer.' Can you help them figure out what an integer is?
Is it half a number?
Could it be a fraction?
Maybe it's a decimal number?
Or is it a whole number?
Sarthak, Nila, and Rishab are playing a math game. Sarthak says '*' is for making numbers bigger in a special way, Nila thinks '*' is for putting numbers together, and Rishab believes '*' is for sharing equally. Who is correct?
Sarthak, because '*' performs multiplication
Nila, because '*' performs addition
Rishab, because '*' performs division
None of them, because '*' performs subtraction
Sophie, Tyler, and Nila are working on a science project! They need to keep track of various measurements and observations. Why do you think they use variables in their programming project?
To change the project's hypothesis
To record the data they collect
To measure the time spent on the project
To enhance the presentation of their project
Zach, Nila, and Aiden are working on a programming project and stumbled upon these symbols: (). They are trying to remember what these are called in programming. Can you help them identify the correct term?
brackets
quotation marks
half circles
parentheses
Tyler is writing a computer program to control his smart home devices. He needs to set up a condition to turn on the heating system. What three keywords make up the 'if statement' structure he should use in his Python code?
if, egg, else
if, elif, else
if, elif, egg
if, excited, scream
Aiden and Sophie are working on a Python script to display their favorite movie titles. However, they've encountered an error in their print statement. Can you identify what's wrong?
print "Inception is our favorite movie"
no quotation marks
no parentheses
no commas
no capital letters
Rudraksh, Aneesh, and Sryian are discussing their favorite soccer teams. Rudraksh wrote a piece of code to verify if his favorite team is 'Barcelona'. However, there seems to be an error in his code. Can you identify it?
if team == (“Barcelona”)
Rudraksh forgot to use quotation marks
Rudraksh used unnecessary parentheses
Rudraksh didn't use capital letters
Rudraksh forgot to use a colon
Kyle is writing a Python program to store his favorite soccer team. What does the equal sign mean in the following line of code?
favorite_team = input("Enter your favorite soccer team")
assigns a value to a variable
tests for equality
indicates a greater value
represents an integer
Kyle is comparing two numbers in his Python homework. He wants to check if the numbers are equal. Which operator should he use?
less than
equal to
greater than
not equal to
Ayush, Lakshan, and Deetya are working on a coding project. They need to link several words together to form a sentence. What is this process called in programming?
Combining
Connecting
Concatenation
Stringing
In a video game, why would Eric use a WHILE loop for his character to keep collecting coins?
To collect coins repeatedly without checking conditions
To collect coins repeatedly until his character's backpack is full
To make the game run faster
To expand the game world
In our programming class, Ayush and Sofia built a 'guess the number' game where the computer picks a number between 1 and 20. Which Python module did they import to generate the random number?
pickle
tuple
random
turtle
Kyle is comparing the heights of his friends. Which statement will check to see if Neil is shorter than both Ira and Eric?
if Neil < Ira < Eric:
if Neil < Ira and Neil < Eric:
if Neil < Ira and Eric:
if Neil < Ira and Ira < Eric
Sophie is keeping track of the number of books she reads. She has a variable 'Score' that she increments by 1 each time she finishes a book. Which of the following is another way for Sophie to write 'Score = Score + 1' in her code?
Score.add(1)
score + 1
Score + Score
Score += 1
Spoorthi is writing a love letter to Neil. She wants to know the length of the word 'love' in her letter. What is the number returned by the code she uses:
len("love")
1
2
3
4
In a Python programming class, Viraj is explaining to Kyle that there are three logical operators in Python:
and, or, ____
in
else
not
true
In a programming project, Lakshan needs to define a variable that can only hold True or False values. Which data type should he use?
int
string
bool
float
T/F: The first character of a string is at index 1
True
False
If word = "windows", what is the output of the code: print(word[-1])?
"i"
"w"
"s"
"n"
a set of commands written so they can be called with one line of code is a:
function
variable
parameter
for loop
Which of the following is correct if I want the user to input a number to be used as the radius of a circle?
radius=num(input("What should the radius be?))
radius=input("What should the radius be?")
radius=int("What should the radius be?")
radius=int(input("What should the radius be?"))
Which Python keyword ends a loop?
break
continue
end
endloop
Which Python keyword skips back to the beginning of a loop?
break
continue
skip
back
!= means _________ in Python.
error
not equal to
greater than
break
people = ["John", "Rob", "Bob"]
print (people[4])
what would this result be?
print(str(i) * 5)
print("i" * i)
print("i" * i)
print(str(i) * i)
Which of the following for loops would print the following numbers?
3
5
7
9
for i in range(3, 10, 2):
print(i)
for i in range(3, 9, 2):
print(i)
for i in range(9):
print(i)
for i in range(3,9):
print(i)
