0

Hey everyone, I'm fairly new to python and have hit a brick wall in a program I'm writing. I need to read in a text file containing values (No problems here) the text file looks like this

10, .25, .26
12, .44, .34
4, .22, .56

The numbers 10, 12, and 4 are supposed to be index numbers where those are used to print 1-10, 1-12, and 1-4. I'm stuck on trying to use these values in the text file.

Anything at all would be helpful!

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by snippsat
0

You can look at this,for taking out values.

l = []
for i in open('your.txt'):
    l.append(i[0:2])
    
print l
l1 = l[0]
print l1

'''Out-->
['10', '12', '4,']
10
'''
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.