Script that counts amount of Notes and Coins in box in Python does not work

Asked

Viewed 223 times

-8

PRINT DO SCRIPT PYTHON CONTADOR DE CEDULAS E MOEDAS

Help me make this script work.

  • Can you copy and paste the code here? and describe your problem better, what’s going on?

1 answer

-2


Try the code below:

print('=== FECHAMENTO DE CAIXA  ===')

# Valores
m1 = 0.05
m2 = 0.1
m3 = 0.25
m4 = 0.5
m5 = 1
c1 = 2
c2 = 5
c3 = 10
c4 = 20
c5 = 50
c6 = 100

# Input de Quantidade de Cedulas (Caso o input seja vazio, a quantidade é 0)
print('Digite a quantidade de cada valor abaixo:')
qntd_1 = int(input('5 Centavos: ') or 0)
qntd_2 = int(input('10 Centavos: ') or 0)
qntd_3 = int(input('25 Centavos: ') or 0)
qntd_4 = int(input('50 Centavos: ') or 0)
qntd_5 = int(input('1 Real: ') or 0)
qntd_6 = int(input('2 Reais: ') or 0)
qntd_7 = int(input('5 Reais: ') or 0)
qntd_8 = int(input('10 Reais: ') or 0)
qntd_9 = int(input('20 Reais: ') or 0)
qntd_10 = int(input('50 Reais: ') or 0)
qntd_11 = int(input('100 Reais: ') or 0)

# Calcula o valor de cada cedula/moeda VEZES a quantidade de cada cedula/moeda
caixaValorTotal = (m1*qntd_1) + (m2*qntd_2) + (m3*qntd_3) + (m4*qntd_4) + (m5*qntd_5) + (c1*qntd_6) + (c2*qntd_7) + (c3*qntd_8) + (c4*qntd_9) + (c5*qntd_10) + (c6*qntd_11)

print("O Valor total no caixa é: ", caixaValorTotal)

Try to specify better what the problem is in your next questions and post the code copied here in the stack, so you make our life and your ;)

  • It worked Thanks Very Much Friend!!! I am Noob in script It was badly kk

Browser other questions tagged

You are not signed in. Login or sign up in order to post.