Review Questions
Review Questions
4.01 Complete the following calculations:
(a) 3 + \frac{1}{4}
(b) 4^2 - 0.1
(c) \sqrt{9}
(d) \frac{4-9+6}{1+4^2-6}
4.02 Complete the following calculations:
(a) 8.00 \times 10^{-4} + 0.1 \times 10^{-2}
(b) \log(87.1) + \log(210) + \log(10^{3})
(c) e^{\frac{3.2}{9.1}}
(d) 5(\ln(3)+\ln(e^2))
4.03 Complete the following calculations:
(a) \sin(\frac{\pi}{4}) - \cos(\frac{\pi}{4}) + \tan(\frac{\pi}{4}) -1
(b) \tan(\sin(\pi)^2 + \cos(\pi)^2)
(c) \frac{1}{sin(\pi/3)} + \frac{1}{cos(3\pi/2)}
4.04 The data below set was recorded.
data = [2.1, 3.0, 9.4, 3.0, 8.6]
Using the data above, calculate the following statistics
(a) mean (average)
(b) median (middle)
(c) mode (most often)
(d) standard deviation (assume the data represents a sample)
4.05 The general equation for the distance, d, that a free falling body travels (neglecting air resistance) is below.
Where g is the acceleration due to gravity and t is the fall time. Assume the acceleration due to gravity g = 9.81. How far (what distance) will a ball fall in time t = 20? Solve the problem using variables
4.06 Electrical power P is related to current I and resistance R according to the equation below.
An electrical load with a resistance R = 4,800 running at a current I=0.01 draws how much power P ? Solve the problem using variables.
4.07 The variables below were assigned using the Python REPL.
>>> a = 4
>>> b = 50.22e(-3)
>>> c = 'calc'
>>> d = True
Determine the data type of variables a
, b
, c
, and d
.
4.08 The variables below were assigned using the Python REPL.
>>> P = True
>>> Q = False
>>> R = False
Determine whether the following conditions are True
or False
(a) not P
(b) P and Q
(c) Q and R
(d) (P or Q) and not R
(e) P == not R
(f) Q != (P and Q)
4.09 Print the following output using Python's print()
function.
Today is Friday
TGIF
4.10 Print the following output using Python's print()
function.
Punctuation includes: @ ( { > ? ! ;
4.11 The line of code below was entered into the Python REPL.
>>> s = "Problem"
Complete the following operations:
(a) pull out the letter "r" from the word "Problem"
(b) pull out the first three letters from the word "Problem"
(c) pull out the last letter of the word "Problem"
4.12 The following lines of code were entered into the Python REPL
a = "Problem"
b = "Solving"
c = "is"
d = "Fun"
e = "!"
Using the variables defined above, print out the following statement. (Hint: the string with one space is defined with g = " "
)
Problem Solving is Fun!
4.13 Write a line of code that produces the word Danger!
five times, like below.
Danger! Danger! Danger! Danger! Danger!