-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathex016.py
More file actions
52 lines (48 loc) · 1.74 KB
/
Copy pathex016.py
File metadata and controls
52 lines (48 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
from os import system as cmd
from time import sleep as wait
def rerrada():
cmd('cls'), print('Digites apenas valores correspondentes ao menu.'), wait(3), cmd('cls')
i , aux, clientes = 0 , True, {"nome": [], "email": [],"endereco":[]}
while aux:
cmd('cls')
print('[1] - Cadastrar clientes\n[2] - Listar clientes\n[3] - Encerrar programa')
a = None
try:
a = input('')
except KeyboardInterrupt:
pass
if a == '1' :
while True:
cmd('cls'), print('[1] - Cadastrar\n[2] - Voltar\n[3] - Encerrar')
try:
a = input('')
except KeyboardInterrupt:
pass
if a == '1':
cmd('cls')
clientes['nome'].append(input('Digite o nome: '))
clientes['email'].append(input('Digite o email: '))
clientes['endereco'].append(input('Digite o endereço: '))
cmd('cls')
print('Cliente cadastrado com sucesso !')
wait(3)
i += 1
elif a == '2':
cmd('cls')
break
elif a == '3':
cmd('cls') , print('Encerrando . . .') , wait(3)
aux = False
else:
rerrada()
elif a == '2' :
cmd('cls'), print(f'Você tem {i} clientes cadastrados')
if i != 0 :
for x in range(i):
print(f"Cliente {x+1} Nome: {clientes['nome'][x]}, Email: {clientes['email'][x]}, Endereço: {clientes['endereco'][x]}")
cmd('pause')
elif a == '3' :
cmd('cls'), print('Encerrando . . .'), wait(3)
aux = False
else:
rerrada()