+ 2

# Is this a valid solution for the Halloween candy problem from code coach?

I've come across this problem and when I run my code it only shows first two test cases as right. So please help me. :-) Code: houses = int(input()) d_houses = 2 prob_percent = ( d_houses / houses ) * 100 print(round(prob_percent))

18th Dec 2019, 5:25 PM
psprises
+ 11
First, as Dennis said read 🐍.doc & ... import math ... math.ceil(...) ...
19th Dec 2019, 10:24 AM
Janusz Bujak 🇵🇱 🇺🇦
+ 3
I can't give a direct answer to that because it's a code coach question. You might find what you need in here: https://docs.python.org/3/library/math.html
18th Dec 2019, 5:42 PM
Dennis
+ 2
Thank you for answering my question with patience. :-)
18th Dec 2019, 5:46 PM
psprises
+ 2
I Am Nothing 😞 Don't share code in any question if there is no relationship with Question and also don't say that it's your code. It's a copy code but good thing is that you didn't remove name from code.
19th Dec 2019, 7:24 AM
A͢J
+ 2
Shiva Prakash As you are beginner So you need to clear your basic first otherwise you can't understand anything. Do lots of practice on different types of problems to build up your logic. And good luck for contest.👍👍👍
19th Dec 2019, 7:32 AM
A͢J
+ 1
For example lets have the number 5.3 round would truncate it to 5. According to the wording, you have to round up, so 6 would be the accepted answer, not 5.
18th Dec 2019, 5:37 PM
Dennis
+ 1
How can I do that? (I'm new to programming, so, please don't mind)
18th Dec 2019, 5:40 PM
psprises
+ 1
🅰🅹 - ɪ'ᴍ ᴄʀɪᴍɪɴᴀʟʟʏ ɢᴏᴏᴅ! Thanks for your kind suggestion😊
19th Dec 2019, 8:42 AM
psprises
+ 1