Homework Assignment
Ensure that you adhere to the policies on
academic integrity.
-
(Oops. Same problem as last homework).
Using the illustration style of the chapter, draw a diagram of the final configuration that results after executing the following program:
c = [0, 1, 2]
d = c
c.append(7)
e = list(d)
e.append(8)
- Assume that someone uses the identifier myHouse as a reference to an object representing the actual house in which they live, and similarly yourHouse for another person's house. For example, one such scenario might be portrayed as follows.

Using the real-world analogy of houses, explain the semantics that would be expressed by each of the following Python expressions. Do not answer the question specifically for the above scenario. Instead give an explanation of the general semantics of each Python expression in terms of what it tests or what action it causes.
- myHouse is yourHouse
- myHouse == yourHouse
- myHouse = yourHouse
- myHouse = copy(yourHouse)
- myHouse = deepcopy(yourHouse)
- In English, the colloquial phrase "my house is your house" is used to welcome a guest into a host's home, suggesting that they share the house as it it were their own possession. None of the above Python expressions properly captures the spirit of this original phrase. Give a Python syntax that more accurately portrays such semantics.
Last modified: Sunday, 29 December 2019