Created
December 5, 2012 22:26
-
-
Save alyssonbruno/4220070 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
abruno:/tmp$ cat notas.txt | |
Fulano 8.3 7.6 9.5 6.4 | |
Sicrano 5.6 8.9 7.4 7.5 | |
Beltrano 5.6 7.8 9.4 5. 3 | |
abruno:/tmp$ cat notas.py | |
notas={} | |
for linha in open('notas.txt'): | |
linha_list = linha.strip().split(' ') | |
notas[linha_list[0]]=linha_list[1:] | |
print notas | |
abruno:/tmp$ python notas.py | |
{'Fulano': ['8.3', '7.6', '9.5', '6.4'], 'Sicrano': ['5.6', '8.9', '7.4', '7.5'], 'Beltrano': ['5.6', '7.8', '9.4', '5.', '3']} | |
abruno:/tmp$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment