Question: Need help with the following 4 python questions, please provide Python code along with the answer if applicable. Question 20 (4 points) Which of the

Need help with the following 4 python questions, please provide Python code along with the answer if applicable.

Need help with the following 4 python questions, please provide Python codealong with the answer if applicable. Question 20 (4 points) Which of

Question 20 (4 points) Which of the following are true for objects of Python's "list'l type? Note: This is a HultiSelect question: Choose all that apply. HH The index method can be used to return the position of a given element lJ f'\\ Lists are mutable \\_J f'\\ The appendO method can be used to add a list of lists to the original list \\._J A list can contain multiple instances of the same element Question 21 (2 points) Given S is a 10-element Stack and D is an empty Stack, which of the following codes stores in D the S's elements in reverse order. P.S. the notEmpty(X) function evaluates to True if X is not empty while(notEmpty(S)): push(pop(D),S) while(notEmpty(S)): push(pop(S),D) while(notEmpty(D)): push(pop(D),S) O while(notEmpty(D)): push(pop(S),D) Question 23 (4 points) Given that stack 's' has been initialized with the following code s = aStack(6) iStr = 'Python' for i in range (6) : s. push(iStr[i] ) Match each code to its final output [One option can be selected more than once] 1. for i in range(5): s.pop() P 2. for i in range(2): s.pop() PYT s.pop() 3. for i in range(1): PYTHO s.pop() s.pop() s.pop() PY 4. for i in range(1): s.pop() Question 24 (4 points) Which of the following methods are defined for the queue data structure? Note: This is a Multi-Select question: Choose all that apply. enqueue __len__ pop peek

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!