Reverse number
Reverses a number.
- Use
str()
to convert the number to a string, slice notation to reverse it andstr.replace()
to remove the sign. - Use
float()
to convert the result to a number andmath.copysign()
to copy the original sign.
Reverses a number.
str()
to convert the number to a string, slice notation to reverse it and str.replace()
to remove the sign.float()
to convert the result to a number and math.copysign()
to copy the original sign.