|
|
|
|
|
by mcaledonensis
1163 days ago
|
|
It is incapable of doing any arithmetic, e.g. on a question: 9 - 4 = Answer
There are a few other ways to make this easier.
1. Keep the remainder as an argument.
You can do that by rewriting your divmod() function like this:
def divmod(x, y):
return x, (y % x)
|
|
[Edit]
In the comments, someone pointed out there were actually three answers - one was 5; the other two being 1 and 2. Because these numbers work out at the same value when they are multiplied by 6, I have changed my answer to include all three possibilities.
That was the best one I could get. It goes completely off the rails even with the temperature quite low.