Twa kɔ nsɛm atitiriw so
Log in
Sign up for FREE
arrow_back
Laabri

Semester Final Comp Sci 1

star
star
star
star
star
Last updated about 2 years ago
40 Nsɛmmisa
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
Asemmisa {{asɛmmisaAhyɛnsode}}
1.

What is output by the code below?

print("Comp Sci")

print("Rocks")

Asemmisa {{asɛmmisaAhyɛnsode}}
2.

What is output by the code below?

print("I am a \tninja")

Asemmisa {{asɛmmisaAhyɛnsode}}
3.

What is output by the following code?

print("Math and \nScience")

Asemmisa {{asɛmmisaAhyɛnsode}}
4.

What is output by the following code?

game = "chess"

print("Play")

print(game)

Asemmisa {{asɛmmisaAhyɛnsode}}
5.

What is output by the code below?

p1 = "cherry"

p2 = "chocolate"

print("Do you want", p2, "or", p1, "pie?")

Asemmisa {{asɛmmisaAhyɛnsode}}
6.

What is output by the code below?

print((11%4)+3)

Asemmisa {{asɛmmisaAhyɛnsode}}
7.

What is output by the code below?

print((13//2)+17)

Asemmisa {{asɛmmisaAhyɛnsode}}
8.

What is output by the code below?

print(11.0/2)

Asemmisa {{asɛmmisaAhyɛnsode}}
9.

What is output by the code below?

num = 21

num = num + 7

print(num)

Asemmisa {{asɛmmisaAhyɛnsode}}
10.

What is output by the code below?

x = 54

y = 3.5

print(x-y)

Asemmisa {{asɛmmisaAhyɛnsode}}
11.

What is output by the code below?

def area(width,length):

return width * length

print(area(2,2))

Asemmisa {{asɛmmisaAhyɛnsode}}
12.

What is output by the code below?

def area(width,length):

return width * length

print(area(6,5))

Asemmisa {{asɛmmisaAhyɛnsode}}
13.

What is output by the code below?

def double(word):

print(word, word)

double("aplus")

Asemmisa {{asɛmmisaAhyɛnsode}}
14.

What is output by the code below?

def tripleIt(word):

print(word, word, word)

tripleIt("tree")

Asemmisa {{asɛmmisaAhyɛnsode}}
15.

What is output by the code below?

def driving(vehicle):

print("You are driving a", vehicle)

driving("van")

Asemmisa {{asɛmmisaAhyɛnsode}}
16.

What is output by the code below?

def volume(width, length, height):

return width * length * height

print(volume(2,2,2))

Asemmisa {{asɛmmisaAhyɛnsode}}
17.

What is output by the code below?

def volume(width, length, height):

return width * length * height

print(volume(2,3,4))

Asemmisa {{asɛmmisaAhyɛnsode}}
18.

What is output by the code below?

def singing(song):

print("They are singing",)

print(song)

singing("Twinkle Twinkle Little Star")

Asemmisa {{asɛmmisaAhyɛnsode}}
19.

What is output by the code below?

def slope(deltaX, deltaY):

return deltaY/deltaX

print(slope(4,8.0))

Asemmisa {{asɛmmisaAhyɛnsode}}
20.

What is output by the code below?

def sayStuff():

print("Hello")

print("World")

sayStuff()

Asemmisa {{asɛmmisaAhyɛnsode}}
21.

What is output by the code below?

print("left" == "right" or False == False)

Asemmisa {{asɛmmisaAhyɛnsode}}
22.

What is output by the code below?

print("cat" != "dog")

Asemmisa {{asɛmmisaAhyɛnsode}}
23.

What is output by the code below?

grade = 85

print (grade < 70)

Asemmisa {{asɛmmisaAhyɛnsode}}
24.

What is output by the code below?

greaterThan = 15 > 10

print(greaterThan)

Asemmisa {{asɛmmisaAhyɛnsode}}
25.

What is output by the code below?

temp = 19

if temp >=212:

print("Boiling")

elif temp <= 32:

print("Freezing")

Asemmisa {{asɛmmisaAhyɛnsode}}
26.

What is output by the code below?

x = 250

width = 50

print("Moving Right")

if x + width > 800:

print("Hit Edge")

Asemmisa {{asɛmmisaAhyɛnsode}}
27.

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

Asemmisa {{asɛmmisaAhyɛnsode}}
28.

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

Asemmisa {{asɛmmisaAhyɛnsode}}
29.

What is output by the code below?

answer = "cup"

if answer != "yes":

print("Game Over")

else:

print("Game Start")

Asemmisa {{asɛmmisaAhyɛnsode}}
30.

What is output by the code below?

pie = "cherry"

print("Shopping List \neggs \nflour")

if pie == "cherry":

print("cherries")

Asemmisa {{asɛmmisaAhyɛnsode}}
31.

What is output by the code below?

for x in range(4):

print(x, end = " " )

Asemmisa {{asɛmmisaAhyɛnsode}}
32.

What is output by the code below?

for n in "numbers":

print(n, end = " " )

Asemmisa {{asɛmmisaAhyɛnsode}}
33.

What is output by the code below?

for x in range(5):

print("Hi", end = " " )

Asemmisa {{asɛmmisaAhyɛnsode}}
34.

What is output by the code below?

for x in range(3):

print("light", end = " " )

Asemmisa {{asɛmmisaAhyɛnsode}}
35.

What is output by the code below?

sum = 0

for t in range(5):

sum += t

print(sum)

Asemmisa {{asɛmmisaAhyɛnsode}}
36.

What is output by the code below?

for s in range(4, 8):

print(s, end = " " )

Asemmisa {{asɛmmisaAhyɛnsode}}
37.

What is output by the code below?

i = 0

while i < 0:

i += 5

print(i)

Asemmisa {{asɛmmisaAhyɛnsode}}
38.

What is output by the code below?

j = 0

while( j < 6 ):

j += 4

print(j)

Asemmisa {{asɛmmisaAhyɛnsode}}
39.

What is output by the code below?

r = 1

while( r < 20 ):

r *= 2

print(r)

Asemmisa {{asɛmmisaAhyɛnsode}}
40.

What is output by the code below?

w = 20

while w < 50:

w += w // 2

print(w)