Question: Model 1 Python Calculator In a Python Shell window, > > > is a prompt indicating that the interpreter is waiting for input. All

Model 1 Python Calculator
In a Python Shell window, >>>" is a prompt indicating that the interpreter is waiting for input.
All text entered after the prompt will be executed immediately as Python code.
If you type a Python expression (code that results in a value) after the prompt, Python will
show the value of that expression, similar to a calculator. You can use Python's math module to
perform more complex mathematical operations like logarithms and trigonometric operations.
Questions:
1. In the middle "Predicted output" column, write what value you expect will be displayed, based on your team's experience using a calculator. If there are any lines you are not confident about, place an asterisk next to your predicted output.
2. Open a Python Shell on your computer. Type each Python expression at the prompt, one
line at a time, and write the corresponding Python output in the third column above. If an error occurs, write what type of error it was (i.e., the first word of the last line of the error message).
3. What does the ** operator do?
4. Based on the Python code in Model 1, identify four examples of:
a) mathematical operator
b) mathematical function
5. For addition and multiplication to produce an output with a decimal value, what type of number must be part of the input? Provide justification for your answer.
6. Does division follow the same rule as in #5? Provide justification for your team's answer.
7. The output of Model 1 displayed three different errors. Explain the reason for each:
a) TypeError
b)1st NameError
c)2nd NameError
8. Identify two differences between using a Python built-in function (e.g., abs) and a function from the math module.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!