Python · Question 1 · Easy
What will be the output of the following Python code?
print(7 // 2, 7 % 2, 7 / 2)
- 3 1 3.5
- 3.5 1 3.5
- 3 1 3
- 3.5 1 3
Answer and explanation
Answer: A. 3 1 3.5
Explanation: // is floor division (3), % is the remainder (1), and / is true division, which always returns a float (3.5).
Next: What will be the output of the following Python code?
Practise python
Try a fresh set of python questions with an explanation after every answer, free and without signing up: Python practice. Or sit a full placement mock test.
More python questions
- What will be the output of the following Python code?
- What will be the output of the following Python code?
- What will be the output of the following Python code?
- Which of the following Python built-in types is immutable?
- What will be the output of the following Python code?
- What will be the output of the following Python code?
- What will be the output of the following Python code?
- What will be the output of the following Python code?
- What will be the output of the following Python code?
- What will be the output of the following Python code?
More technical & programming practice
Data Structures · Algorithms · Object-Oriented Programming · DBMS · SQL · Operating Systems · Computer Networks · Software Engineering
LogicWiz Exams home · All practice topics · Placement mock tests · Daily 10 challenge