方法1
def lessThan1(seq):
for index, value in enumerate(seq[:-1]):
if value >= seq[index+1]:
return False
return True
方法2
def lessThan2(seq):
func = lambda x, y: x < y
return all(map(func, seq[:-1], seq[1:]))
方法3
from operator import lt
def lessThan3(seq):
return all(map(lt, seq[:-1], seq[1:]))