Say that you have a file and the list of numbers like
10 20 16 17 82 93 87
How could I add/subtract/ or multiply these individually?
for line in open("file"):
nums = [int(x) for x in line.split()]
# nums now contains a list of integer
# you can add/subtract/multiply by traversing the list
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.