QuestionQ111

VerifiedStrings

What behavior should be expected from this code?

Question Image

Explanation

Floor division of 1 by 3 evaluates to 0, and str(0) is '0'. The loop leaves dummy as '0', and dummy[-1] retrieves its last character, which is printed as 0.

Community Discussion

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