Task "Halloween candy" | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Task "Halloween candy"

houses = int(input()) #your code goes here house_cash = 2 result = house_cash / houses print (round(result * 100)) Do i have something wrong? Please check my code)

29th Jan 2024, 4:21 PM
ŠŸŃ–Š³Ń–Š“Š° Š”Š°Š½ŠøŠ»Š¾
ŠŸŃ–Š³Ń–Š“Š° Š”Š°Š½ŠøŠ»Š¾ - avatar
2 Respostas
+ 9
Use math library ceil function rather then rounding. In the below thread it is explained well. https://www.sololearn.com/Discuss/3256055/?ref=app
29th Jan 2024, 4:32 PM
D Shah šŸŽÆā³ļø
D Shah šŸŽÆā³ļø - avatar
+ 2
In this task it is written to round the result to the nearest integer, but in fact it is always necessary to round up. You can do this with round(), with a little addition, think about what you need to do so that round() always rounds up...šŸ˜Ž
29th Jan 2024, 11:02 PM
Solo
Solo - avatar