QuestionQ284

VerifiedComputer Programming and Python Fundamentals

What is the expected output from the following code?

print(chr(ord('z') - 2))  
Explanation

The Unicode code point for z is two positions after x; subtracting 2 from ord('z') gives the code point for x, and chr() converts it back to that character.

Community Discussion

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