November 2018
Beginner
472 pages
13h 5m
English
In Python 2, using the single slash (/) division operator results in integers even if the result is non integer, by rounding them. In Python 3, this is not the case. Since we are talking about hardware, most hardware is being sent bytes of data that must be in integer form. So, in places where we were relying on that integer division the code could be made explicit with the double slash (//) operator, or better yet converting values to integers with int(<some result>) where that is needed.
Using int(<some result>) around an operation is compatible with both Python 2 and Python 3.