Hw04 solutions (UCB CS61A@2021 Fall)
Mobiles
Q2: Weights
Implement the
planetdata abstraction by completing theplanetconstructor and thesizeselector so that a planet is represented using a two-element list where the first element is the string'planet'and the second element is its size.
From the description, we can know what is planet. It is a ['planet', size]. Then we can take a look at the mobile function, the solution is quite similar.