4 ms·
https://docs.python.org/3/library/functions.html#in https://docs.python.org/3/library/functions.html#in For floats it truncates towards zero. positive_round(-
by javcasas 3y ago
https://docs.python.org/3/library/functions.html#in https://docs.python.org/3/library/functions.html#in
For floats it truncates towards zero.
positive_round(-1.2) is 0.
Also, what is the value of positive_round("1")? I hope it is an exception, otherwise it will be 10.
- SomeoneFromCA 3y agoWhy? In python you cannot implicitly coerce string to number, of course it will throw exception.