Error: Non-ASCII character... error occurs.

Asked 2 years ago, Updated 2 years ago, 16 views

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))

python

2022-09-22 12:59

1 Answers

# -*- coding: utf-8 -*-

Please write that at the top of the code.

For more information, see Next question.


2022-09-22 12:59

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.