0
Pls help me understand what’s wrong with my code
paints = int(input()) x= ((paints*5 + 40)+((paints*5+40)//10)) import math math.ceil(x) print (x) Here’s my code and the task will be in the comments. I can’t pass two hidden tests so I don’t know what’s wrong
6 Antworten
+ 2
Because you use // to cut the number lower than itself while this test asks you to round up
I will attach the code to you in a few minutes
+ 2
to fix your original code,
lose the hard division as Mohammad mentioned.
set x equal to math.ceil(x)
print out the int() version of x
+ 1
+ 1
oh now i see! I probably should have thought more. thanks a lot 🙏🏼🙏🏼
+ 1
thanks Slick! anyway, it feels good to understand both ways to solve this task. thanks a lot 🙏🏼
0
You are getting ready to paint a piece of art. The canvas and brushes that you want to use will cost 40.00. Each color of paint that you buy is an additional 5.00. Determine how much money you will need based on the number of colors that you want to buy if tax at this store is 10%.
Task
Given the total number of colors of paint that you need, calculate and output the total cost of your project rounded up to the nearest whole number.
Input Format
An integer that represents the number of colors that you want to purchase for your project.
Output Format
A number that represents the cost of your purchase rounded up to the nearest whole number.
Sample Input
10
Sample Output
99