What is missing in this code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is missing in this code?

I'm trying to do Halloween Candy challenge but it always says there's problem after 3rd case. What am I missing? houses = int(input()) if houses >=3: print(round(2/houses*100))

8th Oct 2023, 7:07 AM
Halil AZMAN
Halil AZMAN - avatar
5 Answers
+ 3
Instead of round, you should use math.ceil
8th Oct 2023, 7:11 AM
Jan
Jan - avatar
+ 2
Maybe you forgot to import math
8th Oct 2023, 7:32 AM
Jan
Jan - avatar
+ 2
Some of the challenges require you to import library. Search for modules about math, date and datetime, it will come in handy.
8th Oct 2023, 8:58 AM
Wong Hei Ming
Wong Hei Ming - avatar
+ 1
Okay, thank you. Edit: tried and it gave an error.
8th Oct 2023, 7:13 AM
Halil AZMAN
Halil AZMAN - avatar
+ 1
I don't know that, I'll check it 👍
8th Oct 2023, 7:33 AM
Halil AZMAN
Halil AZMAN - avatar