Created
February 10, 2012 14:42
-
-
Save pedrolopesme/1789961 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
# Vc monta assim | |
dict_medias = {} | |
for pergunta in perguntas: | |
# Atualiza media | |
if pergunta.id in dict_medias: | |
dict_medias[pergunta.id]['media'] = dict_medias[pergunta.id]['media'] + 3 | |
# Cria pergunta | |
else: | |
dict_medias = { pergunta.id : { 'media' : pergunta.media, 'resposta' : pergunta.resposta} } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment