Values and names
Everything Python works with is a value, and every value has a type. A name is a label that points at a value. Assignment with = attaches the label. It never copies anything.
a = [1, 2]
b = a # same list, two names
b.append(3)
print(a) # [1, 2, 3]
a = "text" # a now points elsewhere
print(b) # still [1, 2, 3]Looking at a value
type(x).__name__gives the name of its type.repr(x)gives an unambiguous text form, with quotes around strings.Noneis the value that means "nothing here".==compares values.isasks whether two names point at the same object, so keep it forNone.
The right side of an assignment runs first, which is why x, y = y, x swaps two names without a temporary variable.
Your task
Write describe(value) returning "<type name>: <repr of value>", and swap(a, b) returning (b, a). At the end of the file, print describe(42).
The explanation opens here once every check passes.