math
module, print euler's number to 5 digits precision in scientific notation formatv
whose value is None and print it outv
, and print it with 3 digits of precision in scientific notation. You should receive an error. Using the definition of a sentinel value, why would we want to not have an error if printed without formatting (problem 1.3) but receieve an error when we format it?==
. Compare 0.75
and 3 / 4
in Python using ==
(even though we said we should not). Explain why it worked. if
statement that prints a variable if it has a magnitude less than 40, otherwise it prints 'Error, number is too large'. Demonstrate with your variable being -12
.if
statement that compares two variables to see if they're equal. Demonstrate this with two strings.Use this list for the examples [3, 6, 1, 12, 43, 3, 100]
and use only slicing to answer the questions.
6