Someone correct me if I'm wrong but, you're testing for an integer in a string.
#! /usr/bin/env python3 with open('num.txt', 'r') as lines: lines = lines.readlines() print(list(map(str, lines))) for line in lines: print(line.strip())
Output:['10 23 100 9 2\n', '15 63 9 13 55\n', '8 0 69 20 22 9\n', '10 25 33 42 5 8\n']
10 23 100 9 2
15 63 9 13 55
8 0 69 20 22 9
10 25 33 42 5 8
I welcome all feedback.
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags
The only dumb question, is one that doesn't get asked.
My Github
How to post code using bbtags