id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

gaurav1780@gmail.com 01_variables_and_operators > distance
prev  |  next  |  chance

Define a function that when passed the locations of two points (x1, y1) and (x2, y2), returns the distance between them.


distance(10, 5, 7, 4) → 3.1622776601683795
distance(5, 8, -1, 20) → 13.416407864998739
distance(10, 0, 10, 20) → 20.0

...Save, Compile, Run (ctrl-enter)

def distance(x1, y1, x2, y2):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Difficulty: 1 Post-solution available

Copyright Nick Parlante 2017 - privacy