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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started