QuestionQ244

VerifiedControl Flow – Conditional Blocks and Loops

What output is expected from the following code?

x = 28  
y = 8  
print(x / y)  
print(x // y)  
print(x % y)  
Explanation

For integers 28 and 8, true division produces 3.5, floor division produces 3, and modulo returns the remainder, 4.

Community Discussion

No comments yet. Be the first to start the discussion!