+ 2
Can anyone tell me what is my mistake in this code for "paint cost"
I wrote this code and tried it in an IDE. It works properly there but here just telling Mr It's wrong! x= int(input('Please enter number of colors:')) cost= ((40)+5*x) payment = cost + 0.1 * cost print ('you have to pay:', payment )
6 ответов
+ 3
one way to round up is using the ceil() function from the math module.
from math import ceil
print(ceil(3.14))
+ 5
Do not print anything else than what the rask description telss you.
NO "you have to pay:"
NO "Please enter"
Read the task description carefully. You are supposed to round UP
+ 3
As mentioned above: You are supposed to ***round up***
+ 1
Thanks for your help Dear Lisa; But I still didn't get it. I change my code to this:
color = int(input())
cost= ((color * 5) +40)
payment = (cost + 0.1 * cost)
print (int(payment))
The program runs 3 times correctly in this app but shown 2 wrong tries!
+ 1
First I try to round it up with round() function but it makes the whole of my code doesn't approve by the Application.
Am I use wrong function for rounding up?
+ 1
Thanks a lot, the problem is solved. 😊