20th Jul 2022, 7:12 AM
Durga Prasad Naik
Durga Prasad Naik - avatar
2 Answers
+ 7
Durga Prasad Naik , the issue in the code is the round() function. the task description says: ("halloween candy" from code coach on the community section) Output Format A percentage value rounded up to the nearest whole number. rounding UP means that we have to use the ceil() function instead of round. to use ceil() we need to import the math module.
20th Jul 2022, 9:23 PM
Lothar
Lothar - avatar
+ 3
I dont see any bug, code works fine if you enter number. But if you dont enter number, you will get error, you just need to cover this case somehow, for example to keep asking user to enter number if number is empty or are not number, or to just show text with error if user input is wrong. And it works with intiger, so if user enter float like 0.2 we get error
20th Jul 2022, 7:17 AM
PanicS
PanicS - avatar