Python Forum
Distance between two points!
Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Distance between two points!
#8
(Apr-28-2017, 02:52 AM)zepel Wrote: Use exception handling to convert the user input to float.

This is the reason for the try/except
As for the problem itself.
You should make main function to take no arguments *since you get the coordonates from it*.
Inside main , put
print(distance(x1,y1,x2,y2))
Also , try to use only 1 method.
Either use math.sqrt or **1/2
Reply


Messages In This Thread
Distance between two points! - by zepel - Apr-28-2017, 01:51 AM
RE: Distance between two points! - by Larz60+ - Apr-28-2017, 02:19 AM
RE: Distance between two points! - by zepel - Apr-28-2017, 02:26 AM
RE: Distance between two points! - by volcano63 - Apr-28-2017, 02:38 AM
RE: Distance between two points! - by AussieSusan - Apr-28-2017, 02:49 AM
RE: Distance between two points! - by volcano63 - Apr-28-2017, 03:02 AM
RE: Distance between two points! - by Ofnuts - Apr-28-2017, 09:45 AM
RE: Distance between two points! - by volcano63 - Apr-28-2017, 09:54 AM
RE: Distance between two points! - by zepel - Apr-28-2017, 02:52 AM
RE: Distance between two points! - by Turry - Apr-28-2017, 07:00 AM
RE: Distance between two points! - by Mekire - Apr-28-2017, 07:28 AM
RE: Distance between two points! - by Turry - Apr-28-2017, 07:31 AM
RE: Distance between two points! - by sparkz_alot - Apr-28-2017, 02:38 PM
RE: Distance between two points! - by Larz60+ - Apr-28-2017, 05:17 PM
RE: Distance between two points! - by sparkz_alot - Apr-28-2017, 08:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Simple Distance Between Points Calculator Spade 1 1,805 Sep-17-2021, 03:14 PM
Last Post: DeaD_EyE
  Distance between indicies of a list johnissa 2 3,122 Apr-25-2018, 01:04 AM
Last Post: johnissa

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020