wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Python 1 Review Game

Total questions: 73

Worksheet time: 46mins

Name
Class
Date
1.

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?

a)

echo 'Welcome, Kyle!'

b)

print 'Welcome, Kyle!'

c)

say 'Welcome, Kyle!'

d)

greet 'Welcome, Kyle!'

2.

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?

a)

@echo off

b)

print("CodeCrushers")

c)

print 'CodeCrushers'

d)

echo CodeCrushers

3.

In Python, when Kyle is writing a script to automate his social media posts, a variable needs to

a)

start with a lower case letter

b)

be stated before "print"

c)

have % symbols on either side

d)

Variable????? We don't need variables!!!!

4.

When Nila types her report on the computer for her science project, the text she enters is considered

a)

input

b)

output

c)

storage

d)

process

5.

Sofia is working on her laptop. When she finishes designing a presentation and projects it onto a screen, this is known as

a)

input

b)

output

c)

storage

d)

processing

6.

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

a)

input

b)

output

c)

processing

d)

storage

7.

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?

a)

print('Welcome to the program!')

b)

echo 'Welcome to the program!'

c)

output 'Welcome to the program!'

d)

say 'Welcome to the program!'

8.

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?

a)

rem

b)

#

c)

IGNORE!

d)

( )

9.

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?

a)

XX

b)

!=

c)

<>

d)

_

10.

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?

a)

if temperature=10:

b)

if temperature==10:

c)

if temperature==10;

d)

if temperature="10";

11.

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.

a)

Yes, always indent the line after the condition

b)

No, never indent the line after the condition

c)

Only capitalize every word instead

d)

Just put a colon at the beginning and the end

12.

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?

a)

if secret_number==42:

print("You have discovered the secret!")

b)

if secret_number==42...

print("You have discovered the secret!")

c)

if secret_number==42:

print "You have discovered the secret!"

d)

if secret_number==42:

print( You have discovered the secret!)

13.

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?

a)

loop

b)

variable

c)

function

d)

a remote control

14.

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:

a)

executing a loop

b)

declaring a variable

c)

defining a function

d)

issuing a command

15.

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'?

a)

The program continues running and the loop repeats itself

b)

The program immediately ends

c)

The program resets and starts over

d)

Aditya earns 10 points each time

16.

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"]

a)

"Aiden"

b)

"Sarthak"

c)

"Tyler"

17.

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?

a)

studentList()

b)

studentList[1]

c)

studentList(4)

d)

studentList["4"]

18.

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?

a)

String

b)

Boolean

c)

Float

d)

Integer

19.

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?

a)

( ) round brackets

b)

{ } curly brackets

c)

[ ] square brackets

d)

" " speech marks

20.

Tyler, Aneesh, and Lakshan are arranging their music playlist. If they use playlist.sort(), what will happen to their playlist?

a)

Sort the playlist into alphabetical order

b)

Sort the playlist into reverse order

c)

Create a new playlist

d)

Error

21.

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?

a)

It removes the first occurrence of the song inside the parenthesis from the playlist.

b)

It adds the song inside the parenthesis to the end of the playlist.

c)

It reverses the order of the songs inside the playlist.

d)

It sorts the playlist of songs in alphabetical order.

22.

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?

a)

['Viraj', 'Tyler', 'Sarthak', 'Rudraksh', 'Kyle']

b)

['Viraj', 'Tyler', 'Sarthak', 'Viraj', 'Kyle']

c)

['Viraj', 'Tyler', 'Viraj', 'Rudraksh', 'Kyle']

d)

Error

23.

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)

a)

Sofia

b)

'Sofia'

c)

participant_name

d)

(participant_name)

24.

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?

a)

answer()

b)

open()

c)

print()

d)

input()

25.

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?

a)

STRING

b)

INTEGER

c)

FLOAT

d)

BOOLEAN

26.

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?

a)

STRING

b)

INTEGER

c)

FLOAT

d)

DATE

27.

A circle drawn by Sophie is the same as a Circle drawn by Zach.

a)

True

b)

False

28.

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?

a)

sum

b)

import

c)

print

d)

display

29.

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)

a)

backslashes

b)

quotation marks

c)

apostrophes

d)

parentheses

30.

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?

a)

hashtag

b)

star

c)

loop

d)

asterisk

31.

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?

a)

They highlight the text in yellow

b)

They make the text blink

c)

They comment out parts of the code

d)

They underline the text

32.

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?

a)

Kyle

b)

Viraj

c)

Nila

d)

None of them

33.

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?

a)

decimal number

b)

whole number

c)

half a number

d)

a fraction

34.

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?

a)

Is it half a number?

b)

Could it be a fraction?

c)

Maybe it's a decimal number?

d)

Or is it a whole number?

35.

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?

a)

Sarthak, because '*' performs multiplication

b)

Nila, because '*' performs addition

c)

Rishab, because '*' performs division

d)

None of them, because '*' performs subtraction

36.

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?

a)

To change the project's hypothesis

b)

To record the data they collect

c)

To measure the time spent on the project

d)

To enhance the presentation of their project

37.

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?

a)

brackets

b)

quotation marks

c)

half circles

d)

parentheses

38.

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?

a)

if, egg, else

b)

if, elif, else

c)

if, elif, egg

d)

if, excited, scream

39.

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"

a)

no quotation marks

b)

no parentheses

c)

no commas

d)

no capital letters

40.

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”)

a)

Rudraksh forgot to use quotation marks

b)

Rudraksh used unnecessary parentheses

c)

Rudraksh didn't use capital letters

d)

Rudraksh forgot to use a colon

41.

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")

a)

assigns a value to a variable

b)

tests for equality

c)

indicates a greater value

d)

represents an integer

42.

Kyle is comparing two numbers in his Python homework. He wants to check if the numbers are equal. Which operator should he use?

a)

less than

b)

equal to

c)

greater than

d)

not equal to

43.

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?

a)

Combining

b)

Connecting

c)

Concatenation

d)

Stringing

44.

In a video game, why would Eric use a WHILE loop for his character to keep collecting coins?

a)

To collect coins repeatedly without checking conditions

b)

To collect coins repeatedly until his character's backpack is full

c)

To make the game run faster

d)

To expand the game world

45.

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?

a)

pickle

b)

tuple

c)

random

d)

turtle

46.

Kyle is comparing the heights of his friends. Which statement will check to see if Neil is shorter than both Ira and Eric?

a)

if Neil < Ira < Eric:

b)

if Neil < Ira and Neil < Eric:

c)

if Neil < Ira and Eric:

d)

if Neil < Ira and Ira < Eric

47.

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?

a)

Score.add(1)

b)

score + 1

c)

Score + Score

d)

Score += 1

48.

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")

a)

1

b)

2

c)

3

d)

4

49.

In a Python programming class, Viraj is explaining to Kyle that there are three logical operators in Python:
and, or, ____

a)

in

b)

else

c)

not

d)

true

50.

In a programming project, Lakshan needs to define a variable that can only hold True or False values. Which data type should he use?

a)

int

b)

string

c)

bool

d)

float

51.
Which function casts a number to a string?
a)
str()
b)
int()
c)
parseInt()
d)
convert
52.
Used to create exponents
a)
**
b)
"""
c)
%
d)
#
53.
Returns the remainder from division
a)
modulo (mod)
b)
exponents
c)
boolean
d)
variables
54.
a line of text that Python won't try to run as code
a)
comment
b)
modulo (mod)
c)
variable
d)
boolean
55.
symbol used for modulo (mod)
a)
%
b)
&
c)
#
d)
**
56.

T/F: The first character of a string is at index 1

a)

True

b)

False

57.

If word = "windows", what is the output of the code: print(word[-1])?

a)

"i"

b)

"w"

c)

"s"

d)

"n"

58.

a set of commands written so they can be called with one line of code is a:

a)

function

b)

variable

c)

parameter

d)

for loop

59.

Which of the following is correct if I want the user to input a number to be used as the radius of a circle?

a)

radius=num(input("What should the radius be?))

b)

radius=input("What should the radius be?")

c)

radius=int("What should the radius be?")

d)

radius=int(input("What should the radius be?"))

60.

Which Python keyword ends a loop?

a)

break

b)

continue

c)

end

d)

endloop

61.

Which Python keyword skips back to the beginning of a loop?

a)

break

b)

continue

c)

skip

d)

back

62.

!= means _________ in Python.

a)

error

b)

not equal to

c)

greater than

d)

break

63.
What is syntax?
a)
Syntax is the word used to describe an error
b)
Syntax is the rules of the programming language
c)
It is used to read information
d)
It is used to output information 
64.
Code repeated / looped until a condition has been met or a set number of times.
a)
Sequence
b)
Selection
c)
Iteration
d)
Variable
65.
What is python named after
a)
The snake
b)
Television show called Monty Python
66.
What does the term 'debug' mean?
a)
Identify errors and fix them.
b)
Making a calculation
c)
A set of instructions
d)
Looking at code
67.
What syntax can you use to insert a line break between strings so that they appear over multiple lines?
a)
/
b)
\n
c)
\l
d)
n
68.

people = ["John", "Rob", "Bob"]

print (people[4])

what would this result be?

a)
John
b)
Rob
c)
Bob
d)
Error
69.
Which of the following will print:
a)
for i in range(1, 5):   
print(str(i) * 5)
b)
for i in range(1, 5):   
print("i" * i)
c)
for i in range(1, 6):   
print("i" * i)
d)
for i in range(1, 6):   
print(str(i) * i)
70.

Which of the following for loops would print the following numbers?

3

5

7

9

a)

for i in range(3, 10, 2):

print(i)

b)

for i in range(3, 9, 2):

print(i)

c)

for i in range(9):

print(i)

d)

for i in range(3,9):

print(i)

71.
What term defines a method of writing an algorithm using natural language mixed with some program code?
a)
Pseudocode
b)
Source Code
c)
Flow Chart
d)
Machine Code
72.
Which of these would be used to loop through instructions a set number of times?
a)
IF statement
b)
WHILE loop
c)
FOR loop
73.
Consider the loop control structure in programming. Which term describes a loop that continues repeating without a terminating (ending) condition?
a)
Conditional Loop
b)
Unlimited Loop
c)
Sequence Loop
d)
Infinite Loop