Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Model 3 Integers and Floats Every value in Python has a data type which determines what can be done with the data. Enter the following

Model 3 Integers and Floats
Every value in Python has a data type which determines what can be done with the data. Enter the following code, one line at a time, into a Python Shell. Record the output for each line (if any) in the second column.
Questions:
18. What is the data type (int, float, or str) of the following values?Note: if you're unsure, use the type function in a Python Shell.)
a) pi
c) word
b) integer
d) number
19. List the function calls that convert a value to a new data type.
20. How does the behavior of the operators (+and *) depend on the data type?
21. What is the difference between the int function and the round function?
22.What is the value of 3+3+3? What is the value of .3+.3+.3? If you enter these expressions into a Python Shell, what do you notice about the results?
23. In order to store a number with 100% accuracy, what data type is required? How might you precisely represent a bank account balance of $123.45?
24.Try calculating a very large integer in a Python Shell, for example, 123^(456). Is there a limit to the integers that Python can handle?
25. Try calculating a very large floating-point number in a Python Shell, for example, 123.0^(465).Is there a limit to the floating-point numbers that Python can handle?
26. Summarize the difference between the numeric data types (int and float). What are their pros and cons?

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions