Log in
Sign up for FREE
arrow_back
Library

Semester Final Comp Sci 1

star
star
star
star
star
Last updated about 2 years ago
40 questions
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
Question 1
1.

Question 2
2.

Question 3
3.

Question 4
4.

Question 5
5.

Question 6
6.

Question 7
7.

Question 8
8.

Question 9
9.

Question 10
10.

Question 11
11.

Question 12
12.

Question 13
13.

Question 14
14.

Question 15
15.

Question 16
16.

Question 17
17.

Question 18
18.

Question 19
19.

Question 20
20.

Question 21
21.

Question 22
22.

Question 23
23.

Question 24
24.

Question 25
25.

Question 26
26.

Question 27
27.

Question 28
28.

Question 29
29.

Question 30
30.

Question 31
31.

Question 32
32.

Question 33
33.

Question 34
34.

Question 35
35.

Question 36
36.

Question 37
37.

Question 38
38.

Question 39
39.

Question 40
40.

What is output by the code below?
print("Comp Sci")
print("Rocks")
Comp Sci Rocks
Comp Sci
Comp Sci
Rocks
Comp Rocks
Rocks
What is output by the code below?
print("I am a \tninja")
I am a ninja
I am a ninja
I am a
ninja
I am a
ninja
What is output by the following code?
print("Math and \nScience")
Math and
Math and Science
Math and Science
Math and
Science
Science
What is output by the following code?
game = "chess"
print("Play")
print(game)
Play game
Play
game
chess
Play
chess
Play
Chess
What is output by the code below?
p1 = "cherry"
p2 = "chocolate"
print("Do you want", p2, "or", p1, "pie?")
Do you want chocolate or cherry pie?
Do you want pie?
Do you want p2 or p1 pie?
Do you want p1 or p2 pie?
Do you want cherry or chocolate pie?
What is output by the code below?
print((11%4)+3)
5.75
6
5
5.0
6.0
What is output by the code below?
print((13//2)+17)
23.0
23
18.0
23.5
18
What is output by the code below?
print(11.0/2)
5.0
5
1
1.0
5.5
What is output by the code below?
num = 21
num = num + 7
print(num)
14
21
28
7
3
What is output by the code below?
x = 54
y = 3.5
print(x-y)
50.5
3
54
57.5
43
What is output by the code below?
def area(width,length):
return width * length

print(area(2,2))
5
0
5.0
4.0
4
What is output by the code below?
def area(width,length):
return width * length

print(area(6,5))
11
5
6.0
30
30.0
What is output by the code below?
def double(word):
print(word, word)

double("aplus")
aplus
aplus
aplus
word word
word, word
aplus aplus
What is output by the code below?
def tripleIt(word):
print(word, word, word)

tripleIt("tree")
tree, tree, tree
tree
tree
tree
tree
word, word, word
tree tree tree
What is output by the code below?
def driving(vehicle):
print("You are driving a", vehicle)

driving("van")
You are driving a vehicle
You are driving a
van
You are driving a, van
You are driving a
vehicle
You are driving a van
What is output by the code below?
def volume(width, length, height):
return width * length * height

print(volume(2,2,2))
6
6.0
8.0
8
There is no output due to a runtime error.
What is output by the code below?
def volume(width, length, height):
return width * length * height
print(volume(2,3,4))
6
24
6.0
There is no output due to a runtime error.
24.0
What is output by the code below?
def singing(song):
print("They are singing",)
print(song)

singing("Twinkle Twinkle Little Star")
They are singing,
Twinkle Twinkle Little Star
They are singing song
They are singing, Twinkle Twinkle Little Star
Twinkle Twinkle Little Star
They are singing
Twinkle Twinkle Little Star
What is output by the code below?
def slope(deltaX, deltaY):
return deltaY/deltaX

print(slope(4,8.0))
2.0
2
4.0
8.0
32
What is output by the code below?
def sayStuff():
print("Hello")

print("World")

sayStuff()
Hello World
Hello
World
sayStuff
Hello
World
Hello
What is output by the code below?
print("left" == "right" or False == False)
False
left right False
left
right
True
What is output by the code below?
print("cat" != "dog")
dog
True
False
cat dog
cat
What is output by the code below?
grade = 85
print (grade < 70)
70
85
False
True
There is no output due to a syntax error.
What is output by the code below?

greaterThan = 15 > 10
print(greaterThan)
True
15
10
False
There is no output due to a syntax error.
What is output by the code below?
temp = 19
if temp >=212:
print("Boiling")
elif temp <= 32:
print("Freezing")
True
Boiling
There is no output.
19
Freezing
What is output by the code below?
x = 250
width = 50
print("Moving Right")
if x + width > 800:
print("Hit Edge")
False
Moving Right
Hit Edge
Hit Edge
Moving Right
True
What is output by the code below?
score = 200
highScore = 310
if score > highScore:
print("You beat the high score by", score-highScore, "points!")
else:
print("You needed", highScore - score, "points")
200
110
You beat the high score by 110 points!
310
You needed 110 points
What is output by the code below?
numPens = 3
if numPens < 2:
print("I don't have any extras")
else:
print("Yes, you can borrow one")
Yes, you can borrow one
False
True
3
I don't have any extras
What is output by the code below?
answer = "cup"
if answer != "yes":
print("Game Over")
else:
print("Game Start")
yes
Game Over
Game Start
cup
There is no output
What is output by the code below?
pie = "cherry"
print("Shopping List \neggs \nflour")
if pie == "cherry":
print("cherries")
cherries
Shopping List \neggs \nflour
Shopping List
eggs
flour
cherry
Shopping List
eggs
flour
cherries
What is output by the code below?
for x in range(4):
print(x, end = " " )
4 4 4 4
1 2 3 4
4
1 2 3
0 1 2 3
What is output by the code below?
for n in "numbers":
print(n, end = " " )
n n n n n
n u m b e r s
number
0 1 2 3 4 5 6
n
What is output by the code below?
for x in range(5):
print("Hi", end = " " )
0 1 2 3 4
5
Hi
There is no output due to a syntax error.
Hi Hi Hi Hi Hi
What is output by the code below?
for x in range(3):
print("light", end = " " )
light, light, light
1 2 3
0 1 2
light
light
light
light light light
What is output by the code below?
sum = 0
for t in range(5):
sum += t
print(sum)
15
0
10
6
5
What is output by the code below?
for s in range(4, 8):
print(s, end = " " )
4 5 6 7
4 5 6 7 8
4
8
4
5
6
7
What is output by the code below?
i = 0
while i < 0:
i += 5
print(i)
10
15
5
i
0
What is output by the code below?
j = 0
while( j < 6 ):
j += 4
print(j)
J
20
0
8
4
What is output by the code below?
r = 1
while( r < 20 ):
r *= 2
print(r)
32
1
20
2
16
What is output by the code below?
w = 20
while w < 50:
w += w // 2
print(w)
50
67
10
20
68