Question: what would python display on the following >>> from lab07 import * >>> link = Link(1000) >>> link.first ______ >>> link.rest is Link.empty ______ >>>

what would python display on the following >>> from lab07 import * >>> link = Link(1000) >>> link.first 

______

>>> link.rest is Link.empty

______

>>> link = Link(1000, 2000)

______

>>> link = Link(1000, Link())

______

>>> from lab07 import * >>> link = Link(1, Link(2, Link(3))) >>> link.first 

______

>>> link.rest.first

______

>>> link.rest.rest.rest is Link.empty

______

>>> link.first = 9001 >>> link.first

______

>>> link.rest = link.rest.rest >>> link.rest.first

______

>>> link = Link(1) >>> link.rest = link >>> link.rest.rest.rest.rest.first

______

>>> link = Link(2, Link(3, Link(4))) >>> link2 = Link(1, link) >>> link2.first

______

>>> link2.rest.first

______

>>> from lab07 import * >>> link = Link(5, Link(6, Link(7))) >>> link.second 

______

>>> link.rest.second

______

>>> link.second = 10 >>> link # Look at the __repr__ method of Link

______

>>> link.second = Link(8, Link(9)) >>> link.second.first

______

>>> print(link) # Look at the __str__ method of Link

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 Databases Questions!