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

 

jgreenawalt@ccboe.com ccpspython > slopeThroughTheOrigin
prev  |  next  |  chance

Find the slope though two points on a plane where the first point is the origin and the second point is represented by (x, y). You may assume the two points do not lie on the same vertical line.


slopeThroughTheOrigin(3, 3) → 1.0
slopeThroughTheOrigin(4, -4) → -1.0
slopeThroughTheOrigin(2, 1) → 0.5

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

def slopeThroughTheOrigin(x, y):

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

Copyright Nick Parlante 2017 - privacy