Question 2
Back to Exercise
What is the output of the following Python program?
print(1, 2, 3)
print(1, 2, 3, sep="")
print("ab" "cd", "ef")
- A 1 2 3 1 2 3 ab cd ef
- B 1 2 3 123 ab cd ef
- C 1 2 3 123 abcd ef Correct
- D 123 123 abcdef
Correct Answer: Option C
Two string literals written next to each other are joined at compile time ("abcd"), so print receives two values: "abcd" and "ef".
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!