Chapter 3 Computing with numbers Flashcards

1
Q

What is data?

A

information that is stored and manipulated by computer programs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the main two data types covered in this chapter?

A

integer data (int) and floating point data (float)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what is the main difference between integers and floats?

A

floats are numbers that have fractional parts represented while integers are whole numbers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What special function can you run if you are confused on type of data a value is?

A

> > > type
ex:
type (3)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

True or False
Using an int value tells the reader of the program that the value can support fractions.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is another difference between floats and ints?

A

floats can only represent approximations to real numbers. Because of this, it is usually a good rule of thumb to use

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

True or False
Since floating point numbers are extremely accurate, they should generally be used instead of ints.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

True or False
In Python, 4+5 does not produce the same result type as 4+5.0 .

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

In order to use functions in the math library, a program must include:

A

An import statment

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The most appropriate data type for storing the value of Pi is:

A

a float

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Accumulator structure?

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly