Created
March 1, 2017 23:38
-
-
Save marcoscastro/b60f9d74cfeaa61a483988e1436adb80 to your computer and use it in GitHub Desktop.
Código do Sorteio Kit Microsoft
This file contains hidden or 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
| ''' | |
| Extração de dados de um arquivo CSV do Google Forms com nome,e-mail | |
| ''' | |
| import random | |
| pessoas = {} | |
| with open('sorteio.csv', 'r', encoding='utf-8') as f: | |
| lines = f.readlines()[1:] | |
| for line in lines: | |
| dados = line.split(',') | |
| nome, email = dados[1], dados[2] | |
| pessoas[email] = nome | |
| sorteado = random.choice(list(pessoas.items()))[0] | |
| print('Nome: %s' % pessoas[sorteado]) | |
| print('E-mail: %s' % sorteado) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sorteado 1 curso:
Nome: "Elias da Silva Barroso Soares"
E-mail: "[email protected]"
Status: OK
Sorteado 1 curso:
Nome: "Johnatan Rafael Santos Lima"
E-mail: "[email protected]"
Status: OK
Sorteado Kit Microsoft:
Nome: "João Vitor Boing"
E-mail: "[email protected]"
Status: OK