Challenge 1
Format the price with exactly two digits after the decimal point.
price = 12.5
result =
print(result)
Press Ctrl⌘Enter to check your answer
Practice format specifications for width, alignment, numeric precision, and dynamic formatting.
Challenge 1
price = 12.5
result =
print(result)
Press Ctrl⌘Enter to check your answer
Challenge 2
name = "Ada"
result = f""
print(result)
Press Ctrl⌘Enter to check your answer
Challenge 3
amount = 12345.6789
result = f""
print(result)
Press Ctrl⌘Enter to check your answer
Challenge 4
value = 12.3456
width = 9
precision = 2
result = f""
print(result)
Press Ctrl⌘Enter to check your answer