FOUNDATIONS OF
PROGRAMMING
(PYTHON) EXAM
1. What is the correct way to print text in Python?
A. echo("Hello")
B. print("Hello")
C. display("Hello")
D. write("Hello")
Correct Answer: B
Rationale: The built-in print() function outputs text to the console.
2. Which data type is used to store text?
A. int
B. float
C. str
D. bool
END OF
PAGE
1
, WGU E010 LATEST
FOUNDATIONS OF
PROGRAMMING
(PYTHON) EXAM
Correct Answer: C
Rationale: Strings (str) represent sequences of characters.
3. What is the output of print(2 + 3)?
A. 5
B. "23"
C. Error
D. None
Correct Answer: A
Rationale: Python performs arithmetic addition on integers.
4. Which symbol is used for comments in Python?
END OF
PAGE
2
, WGU E010 LATEST
FOUNDATIONS OF
PROGRAMMING
(PYTHON) EXAM
A. //
B. #
C. /* */
D. --
Correct Answer: B
Rationale: # starts a single-line comment.
5. What is the result of type(10)?
A. str
B. int
C. float
D. bool
Correct Answer: B
END OF
PAGE
3
, WGU E010 LATEST
FOUNDATIONS OF
PROGRAMMING
(PYTHON) EXAM
Rationale: 10 is an integer.
6. Which of the following is a valid variable name?
A. 1name
B. name_1
C. name-1
D. name 1
Correct Answer: B
Rationale: Variable names cannot start with numbers or include
spaces/hyphens.
7. What is the output of print("Hi" * 3)?
A. HiHiHi
END OF
PAGE
4