+ 1
how to solve 'halloween candy" challenge ???
actualy i solved all of the challenge except this easy halloween candy challenge https://code.sololearn.com/cAiZqr3lezxz/?ref=app
16 Respuestas
+ 7
import math
print(math.ceil(200/int(input())))
+ 6
Steven M It's same!
Difference: your is a bit more tedious than mine
No need of defining extra variable
2*100 = 200
+ 4
Steven M if you visit house, u will get one would be candy, two would be dollars, and one would be a toothbrush..
Here u need to find percentage of getting dollar bills.
So it is (2/number of house's)*100
Or 200/number of house's
+ 3
import math
print(math.ceil((2/int(input()))*100))
+ 2
for more info..
https://www.sololearn.com/Discuss/2103058/?ref=app
+ 1
Bro can i get some tips for solving challanges
I didn't completed any
I want it in python
+ 1
Gotcha, I used the ceil method to solve this as well, just trying to understand, thanks 👍👍
+ 1
Steven M welcome 👍🙃
+ 1
Mine looks slightly different...
import math
homes=int(input())
print(math.ceil(2/homes*100))
same result 👍👍
0
start with easy challenges .
0
Have you attempted it? What are your thoughts? How do you think you can solve this?
0
h = int(input())
a = 200/h
b = 200//h
if (200/h) >= b+0.5 :
print(int(b+1))
else :
print(int(b))
0
Ajith has you covered, but I do have some questions about your method. Why 200 and all the other variables? The problem doesn't mention them...
0
I see he combined the 2 operations 👍, but why the +1 and the +0.5
0
from math import ceil
houses = int(input())
prc = ceil((2 * 100) / houses)
print(prc)