Jump to content
Fórum Script Brasil
  • 0

Ajuda a resolver um problema em python


Luiz Augusto Alves
 Share

Question

2 answers to this question

Recommended Posts

  • 0

Boa Noite!

Luis, estou começando agora... eu vi esse post, tentei fazer sozinho e conseguir.... esse script deu  certo....

se conseguir melhor o código.. posta pra gente ter conhecimento

Abraços

 

 

 

a = float(input("Informe o seu consumo em KWH ?"))
print("O valor da sua fatura de energia é R$")
if a <=10:
    print(a*5)
elif a <=30:
    print(a*7)
elif a >=30:
    print(a*10)

Resultado.....

 

C:\Users\ander\anaconda3\python.exe "C:/Users/ander/PycharmProjects/Exercicios python/ex0026.py"
Informe o seu consumo em KWH ? 120
O valor da sua fatura de energia é R$
1200.0

Process finished with exit code 0
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Forum Statistics

    • Total Topics
      149.6k
    • Total Posts
      646.2k
×
×
  • Create New...