Solutions to other tests:
Mathematics for the Digital Age
and
Programming in Python
>>> Second Edition
Test 5
- 1.
- A
- 2.
- B
- 3.
- C
- 4.
- D
- 5.
- (a) T (b) T (c) F
- 6.
- C
- 7.
- C
- 8.
- A
- 9.
- A
- 10.
- D
|
- 11.
- C
- 12.
- B
- 13.
- D
- 14.
- D
- 15.
- (b), (c), (d)
- 16.
- (a), (c), (e)
- 17.
- (a), (c), (d), (e)
- 18.
- C
- 19.
- (a) F (b) T (c) T
- 20.
- (a) T (b) F (c) F (d) T
(e) F (f) T (g) F
|
- 21.
- 20
- 22.
- 175316
- 23.
6 9 15 4
12 7 1 14
3 16 10 5
13 2 8 11
- 24.
- def periodicNumber(m, n):
s = (m-1) * '0' + '1'
return int('1' + n * s)
- 25.
- def negative(s):
nines = int('9'*len(s))
r = str(nines - int(s))
r = r.rjust(len(s), '0') # or: while len(r) < len(s): r = '0' + r
return r
- 26.
- a = 1
k = 1
while k < 100:
a = 1 + 1/a
k += 1
print(a)
|