n1 = l1.val if l1 else 0
等价于
if l1:
n1 = l1.val
else:
n1 = 0
data = [a + float(b) for a, b in zip((5, 10), (3, 6)))]
# (8.0, 16.0)
#list(zip((5, 10), (3, 6))) = [(5, 3), (10, 6)]
n1 = l1.val if l1 else 0
等价于
if l1:
n1 = l1.val
else:
n1 = 0
data = [a + float(b) for a, b in zip((5, 10), (3, 6)))]
# (8.0, 16.0)
#list(zip((5, 10), (3, 6))) = [(5, 3), (10, 6)]