I was rewriting some old code when I came across the following:
rounded_val = (len(src_string)/2) * 2
This takes advantage of the behavior of integer division to round the value of the string length, if it is odd, to the first even value in front of it . But integer division is going to change in Python 3, and I need to change this line.
What is the best way to do this?
source share