products = {
"U": {"price": 270, "demand": 40},
"V": {"price": 210, "demand": None},
}
# print data
for product, attributes in products.items():
for attribute, value in attributes.items():
print(f"{product} {attribute:10s} {product}")
The last line should be
print(f"{product} {attribute:10s} {value}")
Incorrect output when parsing nested dictionary
The last line should be
print(f"{product} {attribute:10s} {value}")