QuestionQ6

VerifiedStrings

What behavior is expected from the following code?

Question Image

Explanation

reversed(string) produces the characters '3', '2', and '1'. Each is converted to an integer and added to dummy, so the printed total is 6.

Community Discussion

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