diff --git a/src/data/python-quiz.ts b/src/data/python-quiz.ts index 8c4168fa..834945b1 100644 --- a/src/data/python-quiz.ts +++ b/src/data/python-quiz.ts @@ -1581,6 +1581,15 @@ const pythonQuiz = [ Explanation: "In Python, math.trunc() will return the truncated integer part of the number. When the number is positive, math.trunc() is similar to the .floor() method. But if the number is negative, math.trunc() is similar to the .ceil() method", Link: "https://docs.python.org/3/library/math.html", }, + { + Question: "In Python, what is the output for the following: print([10, 20, 60, 90][:2:])?", + Answer: "[10, 20]", + Distractor1: "[10, 30, 50, 70, 90]", + Distractor2: "[70, 90]", + Distractor3: "[10, 20, 30]", + Explanation: "In Python, list slicing syntax is list[start:stop[:step]]. The start, stop and step parameters are all optional and if omitted will refer to the defaults of 0, length of sequence and 1 respectively.", + Link: "https://python-reference.readthedocs.io/en/latest/docs/brackets/slicing.html", + }, ]; export default pythonQuiz;