Question: Please use Python What do you think will happen if you use a negative number as the second parameter in the round function? For example,
Please use Python

What do you think will happen if you use a negative number as the second parameter in the round function? For example, what should be the result of round (314.159265,-1). Explain the rationale for your answer. After you've written your answer, consult the Python documentation or try out some examples to see what Python actually does in this case. What do you think will happen when the operands to the integer division or remainder oper- ations are negative? Consider each of the following cases and try to predict the result. Then try them out in Python. Hint: recall the magic formula a-(a//b) (b) + (a%b). (a) -10 /1 3 (b)-10 % 3 (c) 10 // -3 (d) 10 %-3 (e)0 -3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
