For two natural numbers a, b, the quotient(a,b) function calculates the quotient(a,b) divided by b I'm writing a recursive version program, but there's an error in the sixth line... Please let me know what the problem is here.
def quotient(a,b):
if a >= b:
return quotient(a-b,b)+1
return 0
a,b = map (int,raw_input(u' Enter two natural numbers: ').split())
print '%d / %d = %d' %(a,b,quotient(a,b))
# -*- coding: utf-8 -*-
Please write that at the top of the code.
For more information, see Next question.
© 2024 OneMinuteCode. All rights reserved.