Answer the question
In order to leave comments, you need to log in
The input is two numbers other than zero. How to display the second number with the sign of the first?
Only elementary arithmetic is available, no ifs and modules (upd.: ...and other built-in python functions).
It will be very cool not to lay out the solution, but to give a couple of hints so that you have the opportunity to think for yourself.
upd2: Thanks to dimonchik2013 for the brilliant solution
Answer the question
In order to leave comments, you need to log in
More in the piggy bank of perversions:math.sqrt(a*a) / a * math.sqrt(b*b)
Divide the first by abs(first) and multiply the second by that result.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question