SyntaxFix
Write A Post
Hire A Developer
Questions
You can use a zip function with a list comprehension :
zip
with open('ex.txt') as f: print zip(*[line.split() for line in f])[1]
result :
('10', '20', '30', '40', '23', '13')