Steven D'Aprano schreef op 2015-08-22 09:00:
On Fri, Aug 21, 2015 at 11:29:52PM +0200, Roel Schroeven wrote:
Joel Goldstick schreef op 2015-08-21 23:22:
so:
print -max(-A, -B)
That's what I mean, yes. I haven't tried it, but I don't see why it
wouldn't work.
It won't work with anything
In a message of Sat, 22 Aug 2015 17:00:55 +1000, Steven D'Aprano writes:
On Fri, Aug 21, 2015 at 11:29:52PM +0200, Roel Schroeven wrote:
Joel Goldstick schreef op 2015-08-21 23:22:
so:
print -max(-A, -B)
That's what I mean, yes. I haven't tried it, but I don't see why it
wouldn't work.
On Fri, Aug 21, 2015 at 11:29:52PM +0200, Roel Schroeven wrote:
Joel Goldstick schreef op 2015-08-21 23:22:
so:
print -max(-A, -B)
That's what I mean, yes. I haven't tried it, but I don't see why it
wouldn't work.
It won't work with anything which isn't a number:
py min(hello,
Joseph Gulizia schreef op 2015-08-20 05:12:
Assume that the grader defines two variables A and B for you. Write a
program which prints out the value
min(A, B)
However, there is a catch: your program is not allowed to use the min
function. Instead, use max in a clever way to simulate min.
Joel Goldstick schreef op 2015-08-21 23:22:
so:
print -max(-A, -B)
That's what I mean, yes. I haven't tried it, but I don't see why it
wouldn't work.
Regards,
Roel
--
The saddest aspect of life right now is that science gathers knowledge
faster than society gathers wisdom.
-- Isaac
On Fri, Aug 21, 2015 at 4:58 PM, Roel Schroeven r...@roelschroeven.net wrote:
Joseph Gulizia schreef op 2015-08-20 05:12:
Assume that the grader defines two variables A and B for you. Write a
program which prints out the value
min(A, B)
However, there is a catch: your program is not allowed
Complicating a simple expression
Coding Exercise: Complication
Assume that the grader defines two variables A and B for you. Write a
program which prints out the value
min(A, B)
However, there is a catch: your program is not allowed to use the min
function. Instead, use max in a clever way to