Test3 failure | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Test3 failure

The task is below 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 My code: https://code.sololearn.com/cc7l9dZKqxIP/?ref=app My code's working with all tests, except third one(and I can't check what's wrong), can you help with it please?

10th Feb 2020, 11:32 AM
dead inside
dead inside - avatar
2 Answers
+ 9
Rounded "up" to the nearest whole number. You are looking for math.ceil and not round. Yes, this drove me crazy as well.
10th Feb 2020, 11:44 AM
Hatsy Rei
Hatsy Rei - avatar
+ 3
Rounded up to the nearest whole number is not working properly in this code. the round function here not work. Solo learn wants that 5.6=5 nearest whole number according to sololearn output checker but round is converting it into 6.that's the reason test3 fail. 4.5=4 and so on. Fix this.
10th Feb 2020, 11:48 AM
Maninder $ingh
Maninder $ingh - avatar