Question: How to solve those code 1. SpecialList is a class that has two instance variables value_list and size. value list refers to a list, and
1. SpecialList is a class that has two instance variables value_list and size. value list refers to a list, and size stores an integer representing the maximum number of items that can be stored in the list. Complete the following code class SpecialList: "A list that can hold a limited number of items."" det init (self, size) (Speciallist, int) >>> SpecialList (10) 5>>> L.size 6 10 7L.value list 8 10 # complete this code 12 13 def punh value (aelf, nev value) : 14(SpecialList, object) ->Nonetype 15 16 Append nex value to this list, if there is enough apace in the 1ist according to its maximun size 17 It there is insufficient apace, new value should not be added to the list. 18 19>L -Speciallist (10) 20 > L.push value (3) 21 L.value 1ist 22 13 23 24 complete this code 25 26 27 det pop most recent value (aelt) 20" (Specia1Liot)>object 29 Precondition: 0 30 31 len(self.value_11at 2 Return the value added moat recently to value llat and remove it trom the 1iat. 34L -Speciallist (10) 35> L.push value(3) 36 > Lpush value (4) 37L.value 1it 38 3, 41 9> L.pop most recent value ()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
