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))
First, as Dennis said read 🐍.doc & ... import math ... math.ceil(...) ...
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
Thank you for answering my question with patience. :-)
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.
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.👍👍👍
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.
How can I do that? (I'm new to programming, so, please don't mind)
🅰🅹 - ɪ'ᴍ ᴄʀɪᴍɪɴᴀʟʟʏ ɢᴏᴏᴅ! Thanks for your kind suggestion😊
Janusz Bujak 🇵🇱 thank you for your answer, but I already got it😅
"A percentage value rounded UP to the nearest whole number."
Dennis I didn't understand, can you please explain in detail?