How to convert numbers from a file into integers

the numbers in the file are alerady split but they are strings.

Doesnt anyone know how to convert them to integers so they can be manipulated as numbers.

You can cast them into integers using int().

For example, given a file full of numbers "file.num"

values = []
with open("file.num") as f:
  for line in f:
     for value in line.split():


Of course this is not production quality since it doesn't handle files that have badly formatted integers. For that, you probably want a try block around the cast to int on line 5