QuestionQ1

Python Basics

Which of the following produces this list?

[65, 66, 67, 68]

Explanation

Applying ord to each character in ABCD returns its numeric character code: A is 65, B is 66, C is 67, and D is 68. In Python 2, map(ord, 'ABCD') returns those values as a list.

Community Discussion

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