+ 1

Hallowin candy solution

Can any one explain me how to solve these problem becuase I only able to correct first 2 problem and other are showing not correct I used round up method and 2*100/houses But still I am not able to complete the problem

10th Oct 2024, 9:29 AM
Shekh mo Mustkim
Shekh mo Mustkim - avatar
7 odpowiedzi
+ 1
Hear, the answer of the code the problem is not in the code but in rouding the value Instead use math.ceil( ) Function that round the value In round 20.1 become 20 But in ceil function 20.1 become 21 and that the answer Code is here.. import math houses = int(input()) #your code goes here result= (2*100/houses) print(math.ceil(result))
12th Oct 2024, 2:03 AM
Shekh mo Mustkim
Shekh mo Mustkim - avatar
+ 6
Show your code
10th Oct 2024, 10:27 AM
Lisa
Lisa - avatar
+ 6
hint: 2.1, 2.2, 2.3 ... houses doesn't make sense
10th Oct 2024, 3:18 PM
「HAPPY TO HELP」
「HAPPY TO HELP」 - avatar
+ 2
Your code does not produce the expected results. Why do you mark your post as "best"?
11th Oct 2024, 4:48 PM
Lisa
Lisa - avatar
+ 1
houses = int(input()) #your code goes here result= (2*100/houses) print(round(result))
11th Oct 2024, 4:46 PM
Shekh mo Mustkim
Shekh mo Mustkim - avatar
+ 1
It's a mistake sorry for that can you give code with explain why I my code not giving the answer
12th Oct 2024, 1:54 AM
Shekh mo Mustkim
Shekh mo Mustkim - avatar