APPENDIXANSWERS TO THE “TEST YOUR KNOWLEDGE” CHALLENGES
Chapter 7
1. False
2. c
3. c
4.
In [22]: (42**0.5)**4 Out[22]: 1764.0000000000002
5.
In [1]: 42 **= 2 File "C:\Users\hanna\Local\Temp/ipykernel_24188/3589881457.py", line 1 42 **= 2 ^ SyntaxError: cannot assign to literal
6. a
7.
In [1]: import math In [2]: round(math.pi, 5) Out[2]: 3.14159
8.
In [1]: type((1, 2, 3)) Out[1]: tuple
9. False
10. String
11. a
12.
print ( """ ^-------^ | > < | | V | \ / --- Hooty Hoot! """)
13.
In [35]: secs = 1824 In [36]: minutes, seconds = ((int(secs ...
Get Python Tools for Scientists now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.