You dont have the local variable
And as wavic pointed out, your code is not easy to follow. There is no reason why you should chain all your functions together, especially if that means that function named getInput is responsible for getting input, checking it, computing and printing results. Probably you should replace it with simpler, more "procedural" approach and use return values of functions.
Something like (just pseudocode hints):
t
defined when you try to use it in the function ballTime
, so line ballHeight = (h + (v*t) - (16*t*t))
will raise an error. Even if you defined t in ballTime (or passed it like an argument), you are not recalculating height in your while loop, so it be will infinite loop.And as wavic pointed out, your code is not easy to follow. There is no reason why you should chain all your functions together, especially if that means that function named getInput is responsible for getting input, checking it, computing and printing results. Probably you should replace it with simpler, more "procedural" approach and use return values of functions.
Something like (just pseudocode hints):
... your modified functions ... def main(): h, v = getInput() # getInput only gets (and checks) input values and returns them maxH = maxHeight(h, v) # maxHeight returns computed height print(..... maxH) ballT = ballTime(h, v) # ballTime returns ball time print(..... ballT) if __name__ == "__main__": main()