Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- #switches
- switchOn=1
- menuChoice=0
- addKey="nome"
- addValue=0
- #dictionary
- agenda={}
- #loop
- while switchOn!=0:
- #menu
- print("MENU")
- print("1-adicionar contato")
- print("2-remover contato")
- print("0-finalizar")
- #operation
- menuChoice=(int(input("DIGITE UMA OPÇÃO :"))
- #add
- if menuChoice==1:
- addKey=input("nome :")
- addValue=int(input("numero :"))
- agenda[addKey]=addValue
- #remove
- elif menuChoice==2:
- addKey=input("remova @: ")
- del agenda [addKey]
- #shutdown
- elif menuChoice==0:
- switchOn=menuChoice
- else:
- break
- #show
- print(agenda)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement