Question: This is an iPython Notebook. You can edit the cells to answer the prompts. Feel free to add more cells as needed. Use Markdown
This is an iPython Notebook. You can edit the cells to answer the prompts. Feel free to add more cells as needed. Use "Markdown" cells writing text. When you are finished, use File -> Download As -> HTML and submit your result on Canvas. Question 1 Part (a) The following cell will generate an error message when run. Figure out what the error message means and fix the code so it runs. question "Why are you excited about Data Science?" answer = " Because Data Science is cool." print (question + answer ) # The error message was telling me that the code is not structured properly. The answer was not defined correctly. Why are you excited about Data Science? Because Data Science is cool. Part (b) The following code will run. Explain why the code is probably not what we wanted to actually do. In [2]: print("Question: " + question + " Answer: + answer") Question: Why are you excited about Data Science? Answer: + answer In [1]: The code does not create a coherent answer to the question. "Answer: + answer" is not a response that makes sense to the question "Why are you excited about Data Science". The word "answer" is meant to be a variable for the expression. However, the code is not structured correctly so the phrase "answer: + answer" was printed instead of the expression it is meant to represent. This code could be fixed by using an assignment statement. Part (c) Here are the dimensions of a box: height = 2 width = 3 depth = 1.5 In [3]: We can think about computing the volume of the box by first computing the area of one face, and then multiplying that by the length of the remaining dimension.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
