数値型で動作することを期待する関数があります。ファイルから操作する数値を読み取っているので、数値ではなく文字列で読み取っています。関数を他の型に対して許容できるようにするか (以下のオプション (A))、関数を呼び出す前に数値に変換するか (以下のオプション (B))?
# Option (A)
def numeric_operation(arg):
i = int(arg)
# do something numeric with i
# Option (B)
def numeric_operation(arg):
# expect caller to call numeric_operation(int(arg))
# do something numeric with arg