擅长:python、mysql、java
<p>所以我们不允许使用进口。我想出了这个主意,你觉得怎么样?在</p>
<pre><code>testi = open(file, "r")
lista = testi.readlines()
testi.close()
dict = {}
for arvo in lista:
arvo = arvo.strip()
type = arvo.split(":")
if type[0] in dict:
dict[type[0]] += float(type[1])
else:
dict[type[0]] = float(type[1])
</code></pre>