Dec-30-2019, 12:07 AM
(This post was last modified: Dec-30-2019, 12:07 AM by Farcrafting.)
Hello.
Iam new here in the forum.
I have a problem with an exercise and hope to get a few tipps and help.
First of all, I'm not a student. I do that for myself.
—————————————————————————————————————————-
The exercise:
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:
Iam new here in the forum.
I have a problem with an exercise and hope to get a few tipps and help.
First of all, I'm not a student. I do that for myself.
—————————————————————————————————————————-
The exercise:
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:
inp = int(input()) def color(stk): colorprice = stk * 5 price = colorprice + 40 tax = (price * 10) / 100 final = price + tax return round(int(final)) print(color(inp))Whats wrong with that? It makes me stupid :D