Don't use `is` to compare integers. This should just be `while c1 != 0 or c2 != 0`, or more concisely, `while c1 or c2`.