.TXT:
194220.00 38.4397984 S 061.1720742 W 0.035
194315.00 38.4398243 S 061.1721378 W 0.036
的Python:
myList = ('38.4397984,061.1720742','38.4398243,061.1721378')
回答問題。 How to take floats from a txt to a Python list as strings
代碼:
with open('haha.txt') as f:
for line in f:
words = line.split()
print words
my_list.append(words[1] + words[3])
我的測試代碼不會產生所期望的結果。它有什麼問題?我錯過了,
...
['38.4397984061.1720742', '38.4398243061.1721378']
代碼是...? –