RosettaCodeData/Task/Loops-Foreach/Python/loops-foreach-4.py

4 lines
134 B
Python

d = {"fortytwo": 42, 3.14159: "pi", 23: "twentythree", "zero": 0, 13: "thirteen"}
for k in sorted(d):
print("%s: %s" % (k, d[k]))