第一部分产生
average = ['2 is the average for mark a',
'1 is the average for mark b',
'1 is the average for mark c',
'2 is the average for mark d',
'1 is the average for mark e',
'1 is the average for mark f',
'1 is the average for mark g',
'1 is the average for mark h',
'1 is the rainfall average for mark i',
'1 is the average for mark j']
然后代码的第二部分产生
z = [1.2423]
我现在试图将平均值的结果与 z 列表进行比较并产生结果。基本上
if the integer value for a is greater than z then print greater than
if the integer value for b is less than z the print less than
if the integer value for c is greater than z the print greater than.
有没有一种方法可以简化我的代码,以便它比较所有平均值而不必手动键入每个 if 语句?即比较所有平均值,然后打印平均值是否小于或大于一行。
谢谢。这是我今天的最后一个问题。