
Foun.CompSci_Final Exam review - Fall
Presentation
•
Computers
•
8th - 10th Grade
•
Medium
Kathleen Ma
Used 9+ times
FREE Resource
1 Slide • 48 Questions
1
COMPSCI_Final Exam review - Fall
by Kathleen Ma
2
Multiple Choice
After this code executes, what is the value of the variable name?
name = input("What is your name? ")
name = "William Shatner"
What is your name?
William Shatner
Name
Whatever the user inputs
3
Multiple Choice
if color == "green":
print("Sounds good! We'll make the car green!")
elif color == "yellow":
print("Sounds good! We'll make the car yellow!")
else:
print("Sounds good! We'll make the car gray by default!")
comparitor
conditional
switch-route
boolean
4
Multiple Choice
A statement is...
A line of code that performs some action
A line of code that ends with a period
A line of code that begins with a # mark
A way to make your code more fashionable
5
Multiple Choice
x = 0
y = 1
if x == y:
x = 1
else:
x = 0
1
Syntax Error
01
0
6
Multiple Choice
What does the print( ) command do?
It causes text output to appear in the console
It gets text input from the user
It turns on the printer
It adds the symbols ( ) to the end of a line
7
Multiple Choice
x = 0
y = 10
if x < y:
x = y
10
100
0
Logic Error
8
Multiple Choice
int( ) is an example of what type of command?
Concatenation ("catting")
Output
Typecast
Interior
9
Fill in the Blanks
Type answer...
10
Multiple Choice
What is a variable?
A type of string literal
A container that holds information
The place where output appears
The difference between two values
11
Multiple Choice
In the following line of code, ID the string literal. (There is only one.)
superhero = "Captain America"
print(superhero)
superhero
Captain America
"Captain America"
12
Multiple Choice
Which of the following is NOT true about conditions?
They are boolean expressions
They always produce the value True or False
You can only have one condition per conditional
They come between the keyword and colon in a conditional clause
13
Multiple Choice
Which of the following data types can be assigned to variables?
String
Integer
Float
All of these
None of these
14
Multiple Choice
In the code below, what line of code that is not part of the conditional.
elif choice == "winter":
if choice == "summer":
location = "outside"
temp = 60
15
Multiple Choice
What is the data type of the value 11.46?
String
Integer
Float
Increment
16
Multiple Choice
What value is in the variable y after this code runs?
10
100
5
1000
17
Multiple Choice
Given the following code, if the user enters 25 as input, what is the final output?
var = input("Please enter a value: ")
total = int(var) + 15
print(total)
25
15
10
40
18
Multiple Choice
What symbol is used in Python to divide with no remainder? (floor division operator)
//
**
%%
++
19
Multiple Choice
What command creates text output in Python?
input("What is your name? ")
name = input("What is your name? ")
print(name)
int(name)
20
Multiple Choice
How do you put an if-statement inside another if-statement (nesting)?
Surround the inner conditional with ( ) symbols
Use two conditions in a row in the second clause
Use two `if` keywords in a row in the second clause
Indent the second conditional underneath the first one
21
Multiple Choice
What type conversion (typecasting) should be used for the input below?
pets = input("Enter the number of pets you have: ")
str(pets)
float(pets)
int(pets)
num(pets)
22
Multiple Choice
The % symbol or modulo operator is used to...
Raise a number to a power
Get the square root of a number
Get the remainder after division
Get whole number division by throwing away the remainder
23
Multiple Choice
What type conversion (typecast) should be used for the variable total in line 2 below?
pets = 2 + 2
print("The total is: " + pets)
str(pets)
float(pets)
int(pets)
num(pets)
24
Multiple Choice
Which of the following chained comparison ranges includes the number 16?
10 < x < 16
10 < x < 20
16 < x < 20
All of the above
25
Multiple Choice
Given the following code, choose the output that would appear in the console.
food1 = "Chicken "
food2 = "Soup"
print(var1 + var2)
Chicken Soup
Chicken
Soup
"Chicken Soup"
26
Multiple Choice
What library is needed in order to use the square root (sqrt) function?
math
randint
random
square
27
Multiple Choice
Given the following code, choose the output that would appear in the console.
num = "Eleven"
num = "Twelve"
print(num)
"Eleven"
Twelve
Eleven
"Twelve"
28
Multiple Choice
What library is needed in order to get random numbers?
math
randint
random
number_generator
29
Multiple Choice
Given the following code, choose the output that would appear in the console.
var = "Yo, "
var += "Adrian!"
print(var)
Yo,
Adrian!
"Yo, Adrian!"
Yo, Adrian!
30
Multiple Choice
Identify the literals in the following code. (There are 2.)
design = "^%^" + var + " #@#"
"^%^"
" #@#"
Both
Neither
31
Multiple Choice
Documentation on a built-in library such as math or random will tell us...
What functions are in the library
What arguments a library function needs
What a library function does
All of the above
32
Multiple Choice
Change line 2 of this code so that the dog's name is printed after the word Here (on the same line).
dog = input("Enter your dog's name: ")
print("Here, ")
print("Here, " dog)
print("Here, " + dog)
print("Here, dog")
print("Here, " + "dog")
33
Multiple Choice
In coding, AI is usually short for...
All Incidents
Added Investigation
Artificial Intelligence
Artificial Interrogation
34
Multiple Choice
Correct the syntax error in the code below so it prints Buy a yearbook.
print "Buy a yearbook."
print("Buy a yearbook.")
print + "Buy a yearbook."
print = (Buy a yearbook.")
print(Buy a yearbook.)
35
Multiple Choice
Which of the following is NOT a logical operator?
and
or
not
equal
36
Multiple Choice
Choose the expression that best represents the sentence: "I plan to go out to the park if the weather is nice and there is no baseball or soccer practice going on."
good_weather and baseball and soccer
good_weather or (baseball and soccer)
not (good_weather or baseball or soccer)
good_weather and not baseball or soccer
37
Multiple Choice
Add a str() typecast to the code below to prevent an error.
num = 42
print("The number is: " + num)
prin(str("The number is: " + num))
print("The number is: " + str("num"))
print("The number is: " + str(num)
print("The number is: " + str(num))
38
Multiple Choice
Add an operator to the code below to prevent an error.
var input("Enter a value: ")
print(var)
var=input("Enter a value: ")
var = input("Enter a value: ")
var + input("Enter a value: ")
var-input("Enter a value: ")
39
Multiple Choice
Which of the following is NOT a useful quality of error messages?
They let us know the computer didn't understand something
They force a program to run until the end, instead of quitting early
They give a hint about where the error is
They give a hint about what the error is
40
Multiple Choice
Why are variables useful?
Unknown values can be stored in them
The same value can be used in multiple places
Complicated calculations can be broken into pieces
All of these
41
Multiple Choice
Rewrite this line of code to use the increment operator.
num = num + 10
num = num += 10
num = num =+ 10
num = num -= 10
num = num =- 10
42
Multiple Choice
What symbol is used for the assignment operator?
+
-
=
*
43
Multiple Choice
In the code below, which uses the concatenation (catting) operator and NOT the addition operator.
money = input("How much is your phone worth? ")
value = 100 + int(money)
print("Your phone is now worth $" + str(value))
value = 100 + int(money)
print("Your phone is now worth $" + str(value))
44
Multiple Choice
What is the final value stored in num?
num = "18" + "18"
36
"36"
1818
There's not enough information to be sure
45
Multiple Choice
Which of the following is an expression, but not a statement?
(Hint: Expressions produce values, statements DO something.)
50 + 50
x = 50
x += 50
print("50")
46
Multiple Choice
What value is the result of this expression?
55 % 5
11
5
275
60
47
Multiple Choice
Which line would be ignored by the computer?
"""
Code Stuff
"""
# Code Stuff
Both
Neither
"""
Code Stuff
"""
# Code Stuff
48
Multiple Choice
What data type is the result of the following expression?
11 / 3
String
Integer
Float
Input
49
Multiple Choice
What data type is the result of the following expression?
input("What is your favorite animal? ")
String
Integer
Float
Input
COMPSCI_Final Exam review - Fall
by Kathleen Ma
Show answer
Auto Play
Slide 1 / 49
SLIDE
Similar Resources on Wayground
44 questions
World War I Begins
Presentation
•
9th - 10th Grade
46 questions
1.3 - Encryption
Presentation
•
9th Grade
44 questions
if clauses - conditional sentences
Presentation
•
9th - 10th Grade
49 questions
Station Models Lab
Presentation
•
8th - 10th Grade
44 questions
Unit 1 - Matter and Chemistry Review
Presentation
•
7th - 9th Grade
41 questions
Interactions between organisms
Presentation
•
9th - 11th Grade
41 questions
The Judicial Branch/Supreme Court
Presentation
•
9th Grade
45 questions
The Concept Of Layering (Main)
Presentation
•
9th Grade
Popular Resources on Wayground
20 questions
STAAR Review Quiz #3
Quiz
•
8th Grade
20 questions
Equivalent Fractions
Quiz
•
3rd Grade
6 questions
Marshmallow Farm Quiz
Quiz
•
2nd - 5th Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
19 questions
Classifying Quadrilaterals
Quiz
•
3rd Grade
12 questions
What makes Nebraska's government unique?
Quiz
•
4th - 5th Grade
Discover more resources for Computers
20 questions
STAAR Review Quiz #3
Quiz
•
8th Grade
7 questions
Warm Up 04.01.2026
Quiz
•
9th Grade
8 questions
Amoeba Sister Asexual vs Sexual Reproduction
Interactive video
•
8th Grade
50 questions
STAAR English 2 Review
Quiz
•
10th Grade
15 questions
Pythagorean Theorem Word Problems Quizizz
Quiz
•
8th Grade
20 questions
Graphing Inequalities on a Number Line
Quiz
•
6th - 9th Grade
4 questions
Spring Break rest and recharge
Presentation
•
6th - 8th Grade
20 questions
Figurative Language Review
Quiz
•
10th Grade