Log in
Sign up for FREE
arrow_back
Library

Semester Final Comp Sci 1 (1/12/2024)

star
star
star
star
star
Last updated about 2 years ago
20 questions
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.

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

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

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

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

tripleIt("tree")
tree tree tree
tree
word, word, word
tree, tree, tree
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, van
You are driving a van
You are driving a
vehicle
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.0
6
8
There is no output due to a runtime error.
8.0
What is output by the code below?
def volume(width, length, height):
return width * length * height
print(volume(2,3,4))
24.0
There is no output due to a runtime error.
24
6
6.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, Twinkle Twinkle Little Star
They are singing
Twinkle Twinkle Little Star
Twinkle Twinkle Little Star
They are singing song
What is output by the code below?
def slope(deltaX, deltaY):
return deltaY/deltaX

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

print("World")

sayStuff()
World
Hello
Hello World
sayStuff
Hello
Hello
World