0
Halloween Candy (Python)
Can someone tell me why Test Case 3, 4 & 5 are hidden?
6 Respostas
+ 6
The instruction says:
"A percentage value rounded ***up*** to the nearest whole number."
For instance, 1.23 would ve rounded up to 2.
+ 3
round is not always up...
+ 2
test cases are hidden to prevent cheating
You can just do:
if input is 1 then output 2.45
else if input is 2 then output 4.77
else if input is 36 then output 512.16
else if input is 429 then output 47290.38
and pass all cases without actually solving the problem
+ 1
Technocrat
import math
print(math.ceil(4.2))
0
And why does it keep telling me to try again? I can't see anything wrong with this code.
houses = int(input())
#your code goes here
print (round(2 / houses * 100))
0
I'm flummoxed. There is no 'Roundup' function in Python. Any clues?