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

Review Quiz

star
star
star
star
star
Last updated 6 months ago
24 Nsɛmmisa
Unit 2 Test Questions
Ɛhia
1
Ɛhia
1
Ɛhia
1
Unit 3 Test Questions
Ɛhia
1
Ɛhia
1
Ɛhia
1
Ɛhia
1
Ɛhia
1
Ɛhia
1
Unit 4 Test Questions
Ɛhia
1
Ɛhia
1
Ɛhia
1
Ɛhia
1
Ɛhia
1
Ɛhia
1
Ɛhia
1
Unit 6 Test Questions
Ɛhia
1
1
Ɛhia
1
Ɛhia
1
Ɛhia
1
Final Section
1
1
1
Asemmisa {{asɛmmisaAhyɛnsode}}
1.

Match the flowchart symbol with its meaning.

Draggable itemarrow_right_altCorresponding Item
arrow_right_alt

Terminal (Start/End)

arrow_right_alt

Process

arrow_right_alt

Decision

arrow_right_alt

Input/Output

arrow_right_alt

Flow line

arrow_right_alt

Subroutine

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

Scenario:

A simple program asks the user to choose heads or tails and enter their choice. The program then randomly generates either heads or tails. Next, the user’s choice is compared to the random result. If the two match, the program displays “You won”. If they do not match, the program displays “You lost.”

Select the correct flowchart from the options shown below that represents this program.

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

What is the decimal value of binary 10110?

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

If translators (compilers and interpreters) did not exist, what would be the primary consequence for modern software development?

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

Identify the syntax error in this code:

from time import sleep

print("Program starting...")
sleep(2)
print("Done!)

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

In Python, what can a string contain?

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

Which of the following print statements is properly formatted with a string? Select all that apply.

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

Which of the following indicates that your file has been saved as a Python file?

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

Which of the following is a comment?

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

What is the output of this code:

name="Garry"

name="Sam"

print(name)

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

In the context of variables, what does 'assignment' mean?

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

Which naming convention rule is violated in this variable name: 'my score'?

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

When you use the input() function in Python, what data type is always returned regardless of what the user enters?

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

Why does adding two input values together result in concatenation instead of mathematical addition?

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

What will happen when this code executes if a user enters 5 and 3?

num1 = input()

num2 = input()

result = num1 + num2

print(result)

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

What is the correct way to convert user input to an integer?

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

What will be the order of operations in the following code?

num = 10 * 3 % 2 - 5

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

What is the value of num in the following code?

num = 18 % 7

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

What will be the data type of num?

num = 5 // 2

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

What will be the output(s) from the following code? (Select all that apply)

friends = 8

family = 4

total_people = friends + family

if total_people >= 10:

print("too many people for the party")

if total_people < 5:

print("not enough people for the party")

if friends > 3:

print("You have a lot of friends!")

if family > 5:

print("You have a big family!")

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

The following code has an error. How can you fix it?

age = input("What is your age?")

decades_old = age / 10

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

Which line of code will cause a variable-naming error?

1) total-score = 50
2) total_score = 50
3) _value1 = 10
4) student2 = "Ava"

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

What does the following code print?

x = 3
y = 9
print(y % x == 0)

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

Assume the user enters: 19

age = input("Age: ")
if int(age) >= 18:
    print("Adult")
if int(age) < 18:
    print("Minor")

What is printed?