Skip to content

Instantly share code, notes, and snippets.

@gileno
Created April 4, 2017 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gileno/2618f4d879c9f913e618fabcfe197a3d to your computer and use it in GitHub Desktop.
Save gileno/2618f4d879c9f913e618fabcfe197a3d to your computer and use it in GitHub Desktop.
Lista de Contatos
numero = input("Quantos contatos quer cadastrar? ")
numero = int(numero)
contador = 0
emails = []
nomes = []
telefones = []
while contador < numero:
nome = input("Nome: ")
nomes.append(nome)
telefone = input("Telefone: ")
telefones.append(telefone)
email = input("E-mail: ")
emails.append(email)
contador = contador + 1
arquivo = open("contatos.csv", "w")
for i in range(numero):
emails[i]
nomes[i]
telefones[i]
arquivo.close()
print("Fim do programa")
##
## escrita
##arquivo = open("teste.txt", "w")
##arquivo.write("oi turma!\nOi de novo")
##arquivo.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment