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

 

chanr@sfusd.edu > distance
prev  |  next  |  chance

Two points in a plane a specified using the coordinates (x1,y1) and (x2,y2). Determine the distance between them.


distance(2, 9, 2, 3) → 6.0
distance(0, 2, -4, -1) → 5.0
distance(2, 4, 5, 10) → 6.708203932499369

...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: 101 Post-solution available

Copyright Nick Parlante 2017 - privacy