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

 

missingLeg


The first parameter is the leg of a right triangle and the second parameter is its hypotenuse. The function returns the length of the missing leg. However, if the leg is greater than, or equal to, the hypotenuse, the function should return the string "BAD".


missingLeg(5, 3) → 'BAD'
missingLeg(3, 5) → 4.0
missingLeg(12, 13) → 5.0

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

def missingLeg( leg, hypotenuse ):

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

Copyright Nick Parlante 2017 - privacy