你使用的是正确的
zip
:
units = ['FL-01','FL-01P','P04A','P05']
existing = [22,5,14,7]
proposed = [47, 8, 38, 95]
d = {u: {'existing': e, 'proposed': p} for u, e, p in zip(units, existing, proposed)}
print(d)
# {'FL-01': {'existing': 22, 'proposed': 47},
# 'FL-01P': {'existing': 5, 'proposed': 8},
# 'P04A': {'existing': 14, 'proposed': 38},
# 'P05': {'existing': 7, 'proposed': 95}}