Question 6
Back to Exercise
What is the output of the following Python program?
a = 7; b = 2; print(a // b, a / b, a % b)
- A 3.5 3.5 1
- B 3 3.5 1 Correct
- C 3 3 1
- D 3 3.5 0.5
Correct Answer: Option B
// is floor division (3), / always gives a float (3.5) and % is the remainder (1).
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!