diff options
| author | pants <niklasjo2004@gmail.com> | 2026-09-21 14:17:15 -0700 |
|---|---|---|
| committer | pants <niklasjo2004@gmail.com> | 2026-09-21 14:17:15 -0700 |
| commit | 3813621611945a0be23384c0c4d395b4c4a614ad (patch) | |
| tree | 1812fd440839272e7dd16f5635e180769a66f5f1 /python/atms-310/homework/homework2.py | |
Diffstat (limited to 'python/atms-310/homework/homework2.py')
| -rw-r--r-- | python/atms-310/homework/homework2.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/python/atms-310/homework/homework2.py b/python/atms-310/homework/homework2.py new file mode 100644 index 0000000..5590979 --- /dev/null +++ b/python/atms-310/homework/homework2.py @@ -0,0 +1,13 @@ +import numpy +rainfall = [0.0, 0.1, 0.6, 0.7, 0.4, 0.3] + +for n in range(len(rainfall)): + x = rainfall[n]*25.4 + if x < 0: + raise ValueError( + 'make sure no one is drinking out of the rainfall meter') + elif x >= 10: + print(x) + +z = numpy.max(rainfall) +print(z*25.4) |
