如何编写代码以获取python中列表中每个列表的最低值?

Tas*_*ker 5 python python-3.x

我需要帮助编写一个代码,以帮助我获得python中列表中每个列表的最小数量.然后,在获得的最低值之外,我必须以某种方式找到最低数字的最高数字.我不允许调用内置的功能minmax,或使用任何其他职能从预先写好的模块.我该怎么做呢?我已经尝试使用以下代码:

for list in ells:
    sort.list(ells)
Run Code Online (Sandbox Code Playgroud)

blh*_*ing 2

由于不允许使用内置函数,因此您可以使用一个变量来跟踪您在迭代子列表时迄今为止找到的最小数字,并使用另一个变量来跟踪您找到的最小数字中的最高数字到目前为止,您已经遍历了列表列表:

l = [
    [2, 5, 7],
    [1, 3, 8],
    [4, 6, 9]
]
highest_of_lowest = None
for sublist in l:
    lowest = None
    for item in sublist:
        if lowest is None or lowest > item:
            lowest = item
    if highest_of_lowest is None or highest_of_lowest < lowest:
        highest_of_lowest = lowest
print(highest_of_lowest)
Run Code Online (Sandbox Code Playgroud)

这输出:4