Python Practice Test 2
Python Practice Test 2
This test consists of multiple-choice and short-answer questions covering Python basics, definitions,
1. What is an algorithm?
a) A type of error
b) A sequence of steps to solve a problem
c) A programming language
d) A function
2. What is a program?
a) A set of stored variables
b) An algorithm written in a programming language
c) A block of reusable code
d) A collection of loops
22. Identify and correct the syntax error in the following code:
if x = 5:
print('x is 5')
24. Explain the difference between syntax errors and logical errors with an example.