Benjamin Ifeoluwa Adebayo
University of the People
CS 1001 - Programming Fundamentals
19th November, 2025
Part 1: Learn From My Mistakes
Question a: Printing my name
Code:
print("Benjamin Adebayo") # Correct
print('Benjamin Adebayo) # Missing one quote (will cause SyntaxError)
print(Benjamin Adebayo) # Missing both quotes (will cause NameError)
Explanation:
When printing text, Python requires quotes. Missing one quote causes SyntaxError: EOL
, while scanning string literal, while missing both quotes treats it as a variable,
giving a NameError. Strings must always be enclosed in quotes to be recognized correctly.
Question b: Difference between * and ** operators
Code:
result_mult = 5 * 3
result_exp = 5 ** 3
print("5 * 3 =", result_mult)
print("5 ** 3 =", result_exp)