+ 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)

5th May 2020, 8:12 AM
Papa Kwasi Ansah Asare
Papa Kwasi Ansah Asare - avatar
10 Antworten
+ 2
Yh it worked
5th May 2020, 10:48 AM
Papa Kwasi Ansah Asare
Papa Kwasi Ansah Asare - avatar
+ 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!!☺️
5th May 2020, 8:30 AM
ANJALI SAHU
+ 1
What error is it showing...in mine it's working properly
5th May 2020, 10:40 AM
ANJALI SAHU
+ 1
It's from code coach.one of the hidden test says my code has a problem
5th May 2020, 10:41 AM
Papa Kwasi Ansah Asare
Papa Kwasi Ansah Asare - avatar
+ 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🙂
5th May 2020, 10:45 AM
ANJALI SAHU
+ 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
5th May 2020, 10:56 AM
ANJALI SAHU
0
Still not working
5th May 2020, 10:32 AM
Papa Kwasi Ansah Asare
Papa Kwasi Ansah Asare - avatar
0
Paint cost
5th May 2020, 10:44 AM
Papa Kwasi Ansah Asare
Papa Kwasi Ansah Asare - avatar
0
But i thought you could use different approaches so why didn't the previous one work
5th May 2020, 10:49 AM
Papa Kwasi Ansah Asare
Papa Kwasi Ansah Asare - avatar