Skip to content

Commit 8efe4ed

Browse files
committed
F-string formating
1 parent ecda8ad commit 8efe4ed

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Kilometerstomile.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@
66

77
# calculate miles
88
miles = kilometers * conv_fac
9-
print('%0.2f kilometers is equal to %0.2f miles' %(kilometers,miles))
9+
print(f'{kilometers:.2f} kilometers is equal to {miles:.2f} miles')

0 commit comments

Comments
 (0)