Professional Documents
Culture Documents
Please be aware that the following questions are not a comprehensive list of questions that students should use to
study for the exam. They are sample questions that students should use to test themselves after they study.
3. Which of the following is an example of a programming language? (select all that apply)
a. Java
b. C++
c. Python
d. C#
Chapter 3
7. A variable name can only contain letters, numbers, and underscores. (TRUE / FALSE)
8. We can have only 1 variable in our program. (TRUE / FALSE)
9. A variable name cannot start with a number. (TRUE / FALSE)
10. We can assign a value to a variable only once within the program. (TRUE / FALSE)
11. What does Python not require you to specify when creating variables?
a. Variable name
b. Variable value
c. Data type of the variable
d. Variable location
12. When giving a variable name we must keep in mind that Python is_________.
a. Case-sensitive
b. Case-insensitive
c. Requires numbers at the start
d. Ignores underscores
14. How can you print multiple values in a single print statement?
a. By using the input keyword
b. By pressing F5 on the keyboard
c. By separating values with commas
d. By using the print keyword
16. What keyword is used to read a value from the user in Python?
a. output
b. input
c. display
d. execute
19. What happens when the user enters a value and presses Enter in an input statement?
a. The value is ignored
b. The value is stored in a variable
c. The program ends
d. The value is displayed on the screen
20. How does Python separate different values by default in the print function?
a. By using the end keyword
b. By using a comma
c. By using a space
d. By using the sep keyword
22. What keyword is used to change the end of a line in the print function?
a. sep
b. input
c. end
d. print
24. For each of the following values, write next to them I (int), F (float), or S (string) to indicate the
data type.
i. “Hello” _S__ “Computing” _S__
ii. 99.99 _F__ 25.6 _F__
iii. 100 _I__ 0 _I__
iv. “Hi” _S__ “hi 5” _S__
v. -5 _I__ 100.01 _F__
28. Use the following variables in Python code to write a statement that will produce the following
output on the Python shell: “The sum of 20, 40, and 60 is 120.”
Chapter 4
3. In the following example: 25 + 65 Operator is __+__, and Operands are _25 and 65__
4. In the following example: 4 * 10 Operator is __*__, and Operands are _4 and 10__
10. To convert an input string into an integer in Python, what function is used?
a. str()
b. float()
c. int()
d. bool()
14. What does the Greater Than operator (>) checks for?
a. If the left value is greater than the right value
b. If the left value is equal to the right value
c. If the left value is less than the right value
d. If the values are not equal
15. What does the Less Than or Equal To operator (<=) do?
a. Checks if the left value is greater than the right value
b. Determines if the left value is equal to the right value
c. Compares whether the left value is less than or equal to the right value
d. Checks if the values are not equal
16. What operator is used to check if two values are equal in Python?
a. =
b. ===
c. =!
d. ==
17. Which operator checks if two values are not equal in Python?
a. >=
b. <=
c. !=
d. >
21. If Num1 = 12 and Num2 = 4, then the value of after using the operation Num1 /=Num2 is _______
a. Num1= 4.0
b. Num1= 3.0
c. Num2= 3.0
d. Num2= 4.0
22. If Num1 = 5 and Num2 = 3, what would be the value of Num3, if Num3= Num1**Num2?
a. Num3= 125.0
b. Num3= 3.0
c. Num3= 5.0
d. Num3= 243.0
23. If Num1 = 3 and Num2 = 4, what would be the value if Num1**= Num2?
a. Num1= 81
b. Num2= 81
c. Num1= 9
d. Num1= 12
Chapter 5:
1. A(n) ____________ statement checks a condition, or more and chooses which sets of instructions to
execute accordingly.
i. Conditional
ii. Sequential
iii. Repetition
iv. Programming
2. ____________statements are statements that are executed one after the other, in sequence.
i. Conditional
ii. Sequential
iii. Repetition
iv. Programming
4. To display an error message if the user entered a value less than zero. We can use the ________
conditional statement.
i. if
ii. if-else
iii. if-elif-else
iv. any of the above
5. I want to check the value the user entered. If it is more than 100, I display an "Invalid number"
message. Otherwise, I display a "welcome" message. I need to use the _______ conditional statement.
i. if
ii. if-else
iii. if-elif-else
iv. any of the above
6. I need to check the results of students, and depending on their percentage, I need to inform them if they
got an A, B, C, D, or F grade. I would use the ____________ conditional statement.
i. if
ii. if-else
iii. if-elif-else
iv. any of the above
7. ____conditional____ statements used for choosing between a set of instructions to execute, depending
on values in the program.
11. What will be the output of the following Python program if A is 20?
BCD
EFG
HIJ
KLM
12. What will be the output of the following Python program if A = 10?
KLM
13. What do you need to do to statements inside the if condition so that they are considered as one block,
grouped inside the conditional statement?
e. Move to the left side.
f. Indent instructions.
g. Make first latter capital.
h. Nothing.
14. What will be the output of the following python program if the value A=17
Not allowed
Bye
15. What will be the output of the following python program if the value A=22
Welcome
on board
Bye
3. Which of the following statements is used to declare a variable named Bunny that we can use
to manipulate the turtle?
a. myTurtle = turtle.Turtle()
b. Turtle = turtle.Turtle()
c. Bunny = turtle.Turtle()
d. turtle.Turtle() = Bunny
6. Which instruction is used to make the turtle stop leaving a trace as it moves? ___penup()____
7. Python instruction that would move the turtle 250 steps to the front.
a. import turtle
b. X = turtle.Turtle()
c. X.forward(250)___
8. The _________ function will make the turtle go to a specific X and Y coordinate.
a. xy()
b. goto()
c. goxy()
d. jump()
9. The__________ function will make the turtle change the pen color.
a. penup()
b. pendown()
c. goto()
d. color()
13. Python instruction that would turn the turtle 90 degrees clockwise.
MyTurtle.right(90)
14. Python instruction that would turn the turtle 60 degrees counter-clockwise.
MyTurtle.left(60)
Chapter 7:
1. A ___________is a group of computers connected together to communicate and share
resources.
a. connected network
b. computer network
c. wifi network
d. internet network
2. The ___________is a group of computer networks that provide different services to users.
a. Website
b. Network
c. WIFI
d. Internet
3. ____________allows users to access a remote computer connected to the internet.
a. Telnet
b. FTP
c. WWW
d. E-mail
4. ________allows users to search for information on different websites.
a. Telnet
b. FTP
c. WWW
d. E-mail
5. A(n) _______ allows users to send and receive files that are too big to fit to be attached to an e-
mail.
a. Telnet
b. FTP
c. WWW
6. A(n) _________ is a group of connected pages that contain information about a specific topic.
a. Web page
b. Web browser
c. Web internet
d. Web site
7. ___________ allows users to chat in real time and both people need to be online at the same
time.
a. WWW
b. FTP
c. Instant Messaging
d. Telnet
8. ___________ allows users to send and receive messages that include text, videos, pictures, or
other file types.
a. Telnet
b. FTP
c. WWW
d. E-mail
9. ________ is an offensive process that aims to steal or damage important data.
a. Cybersecurity
b. Cyberattack
c. Cyberbullying
d. Cybernetwork
10. ________ is a process in which hackers pretend to be a trusted contact and trick internet users
into sending important information.
a. Phishing
b. Malware
c. Virus
d. Application software
11. Computer experts are known as? __Hackers____
12. Cyberattacks can target:
a. Individuals
b. Institutions
c. Both of above
13. __________are hackers whose aim is to improve the security of the computer network.
a. White hats
b. Black hats
c. Gray hats
d. All the above
14. ____________ illegally access the network to cause damage or steal important data.
a. White hats
b. Black hats
c. Gray hats
d. All the above