Halloween candy code easy level. Can someone help what is wrong with this | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

Halloween candy code easy level. Can someone help what is wrong with this

houses = int(input()) print (round((2/houses )*100))

10th Apr 2021, 10:54 AM
ōßō≥ŔĄōßŔÖ ōßŔĄō®ōļōĮōßōĮŔČ
ōßō≥ŔĄōßŔÖ ōßŔĄō®ōļōĮōßōĮŔČ - avatar
2 Réponses
+ 7
Output should be rounded up to the nearest integer. So you need to use math.ceil() instead of round () import math houses = int(input()) print (math.ceil((2/houses )*100))
10th Apr 2021, 10:59 AM
Simba
Simba - avatar
+ 1
Thanks
10th Apr 2021, 11:02 AM
ōßō≥ŔĄōßŔÖ ōßŔĄō®ōļōĮōßōĮŔČ
ōßō≥ŔĄōßŔÖ ōßŔĄō®ōļōĮōßōĮŔČ - avatar