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

 

amgreyson@gmail.com algebra-1 > getXIntercept
prev  |  next  |  chance

Given a linear equation in standard form (Ax + By = C), calculate the x-intercept using the A, B, and C values. If the line is horizontal, return "Horizontal line!" The division operator is a forward slash (/).


getXIntercept(0, 10, -5) → 'Horizontal line!'
getXIntercept(4, 4, 8) → 2
getXIntercept(3, 4, -6) → -2

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

def getXIntercept(A, B, C):

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

Copyright Nick Parlante 2017 - privacy