+ 2

What doesn't works ?

Hello, I don't understand, pylon tells me my line with else: is invalid, but I was working before and I didn't touched it, how ? Any help ? Thank you order = int(input()) uprice = 5 tva = 7/100 discount = 10/100 if order == 1: total1 = uprice+uprice*tva print(total1) else: total = order*uprice totaltva = total+(total*tva) totaldiscount = totaltva-(totaltva*discount) res = "{:.2f}".format(totaldiscount) print (res)

28th May 2022, 4:43 PM
Max Lang
Max Lang - avatar
3 Respostas
+ 5
Max Lang , the print(...) statement in the line above 'else:' needs to have an indentation
28th May 2022, 4:46 PM
Lothar
Lothar - avatar
+ 2
Tank you very much, I still have a lot to learn
28th May 2022, 4:54 PM
Max Lang
Max Lang - avatar
+ 1
Use 4 spaces indentation. It will be quite easier for you to see the blocks.
29th May 2022, 12:59 AM
Emerson Prado
Emerson Prado - avatar