Use Floor division instead of Float division.
The behaviour of the /
operator has changed between python2 and python3 :
- python2 : 3/2 == 1
- python3 : 3/2 == 1.5
To ensure len(iban)/2
is always an integer as it is a list index, use the //
operator.