In: Computer Science
PYTHON COADING In this homework, we are mostly going to work with and manipulate pre-written code. But first, let’s practice writing a few lines of code ourselves.
(a) Create a function that raises any number to the power of 3 and fully annotate in the code itself what each line is doing. Check that your function is operating correctly (this may seem trivial now, but is good practice going forward as your programs become more complicated).
(b) Create three objects, which represent one of each of the following: a list, an array, and a tuple, each with three items.
(c) Multiply each of these three objects by three. What are the
results, and why?
(d) Replace the third item in the array with the number 23. Do the
same for the tuple. Show what happens. Why do you get this
result?
(e) Create a range from 0 to 42 that includes every third number.
(f) Create a table with three rows and three columns, containing any kind of data (made up or real) that you like using pandas and a dictionary. Show the table, and describe the contents of the rows and columns.