Answered step by step
Verified Expert Solution
Link Copied!

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 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions

Question

Explain the concept of Bona fide occupational qualification.

Answered: 1 week ago