Python练习题答案: 数字对【难度:1级】--景越Python编程实例训练营,1000道上机题等你来挑战

数字对【难度:1级】:

答案1:

def get_larger_numbers(a, b):
    return [max(x, y) for x, y in zip(a, b)]

答案2:

def get_larger_numbers(a, b):
    return map(max, a, b)

答案3:

def get_larger_numbers(a, b):
    return map(max, a, b)
    return new_array​

答案4:

def get_larger_numbers(a, b):
    return [max(pair) for pair in zip(a, b)]

答案5:

def get_larger_numbers(a, b):
    return [max(x) for x in zip(a, b)]

答案6:

def get_larger_numbers(a, b):
    return map(max, zip(a, b))

答案7:

def get_larger_numbers(a, b):
    return [max(x) for x in list(zip(a,b))]

答案8:

def get_larger_numbers(a, b):
    return [x+y-min([x,y]) for x, y in zip(a, b)]

答案9:

def get_larger_numbers(a, b):
    return list(map( (lambda q: max(q[0], q[1])), zip(a, b)))

答案10:

def get_larger_numbers(a, b):
    return (list(map(max, zip(a, b))))

答案11:

def get_larger_numbers(a, b):
    """Smart ass"""
    return map(lambda x: max(x[0], x[1]), zip(a, b))



Python基础训练营景越Python基础训练营QQ群

Python练习题答案: 数字对【难度:1级】--景越Python编程实例训练营,1000道上机题等你来挑战_第1张图片
欢迎各位同学加群讨论,一起学习,共同成长!

你可能感兴趣的:(python面试题库和答案,python编程练习,编程基础上,数字,数据类型,Python编程初级练习题)