+ 1
Can someone pls tell me what is wrong with my code
num_colours = input() cost = int(num_colours)*5 cost += 40 tax = cost*(0.1) remains = cost+tax change = round(remains) print(change)
10 Antworten
+ 2
Yh it worked
+ 1
If I am giving a integer value as input..
Then I am not getting error...I think you are giving float as input value...
So for that you can make a little change in your code..
cost = float(num_colours)*5
I HOPE IT HELPS!!☺️
+ 1
What error is it showing...in mine it's working properly
+ 1
It's from code coach.one of the hidden test says my code has a problem
+ 1
Ohh..it is paint cost problem I think..you just do one thing instead of using round use ceil
import math
..
..
change=math.ceil(remains)
This will definitely work🙂
+ 1
Input:math.ceil(4.2))
Output:5
Input:round(4.2))
Output:4
and in the problem you want if its greater than the number then print the next number..as per the given explanation in the code coach
0
Still not working
0
Paint cost
0
But i thought you could use different approaches so why didn't the previous one work