Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Criando_Sistema_Bancário.py #100

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions 00 - Fundamentos/desafio.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
menu = """

[d] Depositar
[s] Sacar
[e] Extrato
[q] Sair
[1] Depositar
[2] Sacar
[3] Extrato
[4] Sair

=> """

saldo = 0
saldo = 1000
limite = 500
extrato = ""
numero_saques = 0
Expand All @@ -17,7 +17,7 @@

opcao = input(menu)

if opcao == "d":
if opcao == "1":
valor = float(input("Informe o valor do depósito: "))

if valor > 0:
Expand All @@ -27,7 +27,7 @@
else:
print("Operação falhou! O valor informado é inválido.")

elif opcao == "s":
elif opcao == "2":
valor = float(input("Informe o valor do saque: "))

excedeu_saldo = valor > saldo
Expand All @@ -53,13 +53,13 @@
else:
print("Operação falhou! O valor informado é inválido.")

elif opcao == "e":
elif opcao == "3":
print("\n================ EXTRATO ================")
print("Não foram realizadas movimentações." if not extrato else extrato)
print(f"\nSaldo: R$ {saldo:.2f}")
print("==========================================")

elif opcao == "q":
elif opcao == "4":
break

else:
Expand Down