diff --git a/kilometers_to_miles.py b/kilometers_to_miles.py new file mode 100644 index 00000000..7b7bf4ae --- /dev/null +++ b/kilometers_to_miles.py @@ -0,0 +1,9 @@ +# Taking kilometers input from the user +kilometers = float(input("Enter value in kilometers: ")) + +# conversion factor +conv_fac = 0.621371 + +# calculate miles +miles = kilometers * conv_fac +print('%0.2f kilometers is equal to %0.2f miles' %(kilometers,miles))