GIAC Python Coder (GPYC) — Question 1

Which of the following would produce this list?
[65, 66, 67, 68]

Answer options

Correct answer: D

Explanation

The correct answer is D because the range(4) generates the numbers 0, 1, 2, 3, and adding 65 to each results in the list [65, 66, 67, 68]. Option A will not work as it attempts to add a number to a list incorrectly, B is syntactically incorrect, and C will not produce the desired list since it maps the ord function over the characters in 'ABCD'.