From 7b21727285e50b0b050c4ddd70d07542229c5366 Mon Sep 17 00:00:00 2001 From: pants Date: Mon, 21 Sep 2026 14:17:03 -0700 Subject: init --- python/atms-310/homework/homework2.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100755 python/atms-310/homework/homework2.py (limited to 'python/atms-310/homework/homework2.py') diff --git a/python/atms-310/homework/homework2.py b/python/atms-310/homework/homework2.py new file mode 100755 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) -- cgit v1.2.3