Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Model 1 Python Calculator In a Python Shell window, > > > is a prompt indicating that the interpreter is waiting for input. All
Model 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:
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.
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 ie the first word of the last line of the error message
What does the operator do
Based on the Python code in Model identify four examples of:
a mathematical operator
b mathematical function
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.
Does division follow the same rule as in # Provide justification for your team's answer.
The output of Model displayed three different errors. Explain the reason for each:
a TypeError
bst NameError
cnd NameError
Identify two differences between using a Python builtin function eg abs and a function from the math module.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started