Sera H.

asked • 02/20/21

how do I get the final answer to 2 decimal places

this is what I have so far



x1 = input ("Enter coordinates for x1: ")

x1 = float (x1)

y1 = input ("Enter coordinates for y1: ")

y1 = float (y1)

x2 = input ("Enter coordinates for x2: ")

x2 = float (x2)

y2 = input ("Enter coordinates for y2: ")

y2 = float (y2) 

d = ( (x2 - x1)**2 + (y2-y1)**2)** 0.5 

print("Distance between",(x1,x2), "and",(y1,y2), "is:",d)




Sera H.

I want to use {:.2f}".format but I don't know where to add it
Report

02/20/21

1 Expert Answer

By:

Patrick B. answered • 02/20/21

Tutor
4.7 (31)

Math and computer tutor/teacher

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.