Skip to content

Commit

Permalink
chore: Added one question regarding python list slicing in python-qui…
Browse files Browse the repository at this point in the history
…z.ts (#533)

* Added one question regarding python list slicing in python-quiz.ts

* Updated the changes requested
  • Loading branch information
dhruvjain896 authored Oct 24, 2022
1 parent 4a758bf commit eb8ba6e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/data/python-quiz.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

0 comments on commit eb8ba6e

Please sign in to comment.