Distance between two points X23724


Statement
 

pdf   zip

html

Using the definition

class Point: """attributes: x, y"""

write a function

dist(p, q)

that returns the Euclidean distance between two points p and q. For example, the distance between the point (0, 0) and the point (30, 40) is 50.

Input

The input consists of several pairs of points (two non-negative integer numbers each).

Output

For each two points, print their Euclidean distance.

Public test cases
  • Input

    0 0 30 40
    30 40 0 0
    10 20 30 40
    30 40 10 20
    

    Output

    50.0
    50.0
    28.284271247461902
    28.284271247461902
    
  • Information
    Author
    Gabriel Valiente
    Language
    English
    Official solutions
    Python
    User solutions
    Python