Question 11
Back to Exercise
What is the output of the following Python program?
def check(n):
if n < 0:
return "negative"
if n == 0:
return
return "positive"
print(check(-1), check(0), check(5))
- A negative 0 positive
- B negative None positive Correct
- C negative positive
- D negative positive positive
Correct Answer: Option B
A bare return ends the function and returns None.
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!