+ 1
Someone Help me fix the error
print("calculation of total cost after discount") n = input("enter the cost") a = int(n) answer=0.9*a print("the final cost is", answer)
2 Respostas
+ 3
The right way to input n is
n=eval(input("enter the cost:"))
where eval get your input
+ 1
?? Can't see an error exactly but here how I would write the code;-
print("calculation of total cost after discount")
n = int(input("enter the cost:-"))
answer = 0.9 * n # this give you 10% discount.
# or answer = n - (0.9 * n) if the 0.9 is the discount
# (90%).
print(answer)