An IBAN is validated by moving the first four characters to the end, replacing each letter with two digits (A = 10 ... Z = 35), and checking the resulting number mod 97 equals 1.
Implement valid_iban(s):
LENGTHS[country] for known countries (unknown countries are invalid)Also implement format_iban(s): upper case, grouped in fours separated by spaces.