GPYC Exam QuestionsBrowse all questions from this exam

GPYC Exam - Question 9


Which of the following would produce this list?

[65, 66, 67, 68]

Show Answer
Correct Answer: CD

The correct option is the one that uses `map(ord, 'ABCD')`. The `ord` function returns the Unicode code point for a given character. Thus, `map(ord, 'ABCD')` converts each character in the string 'ABCD' to their respective Unicode code points, resulting in the list [65, 66, 67, 68].

Discussion

3 comments
Sign in to comment
howefo8913
May 23, 2021

range and int

block933Option: D
Sep 11, 2021

This answer doesn't work in Python3 only python2

VenudharOption: A
Nov 18, 2023

The option is a