+ 1
Why do i get 2/5 in Halloween Candy challenge .. Here's my Code
houses = int(input()) try: if houses >=3: dollar_bill_houses = 2 percentage = round((dollar_bill_houses / houses )*100) print (percentage) else: print ('Input less than 3') except ZeroDivisionError: print('Cant divide by zero')
4 Answers
+ 7
Try to use search bar next time
Hope this helpful! Programming is fun! š¤š
https://www.sololearn.com/Discuss/2421418/?ref=app
https://www.sololearn.com/Discuss/2412999/?ref=app
https://www.sololearn.com/Discuss/2388146/?ref=app
https://www.sololearn.com/Discuss/2349224/?ref=app
https://www.sololearn.com/Discuss/2344447/?ref=app
https://www.sololearn.com/Discuss/2334599/?ref=app
https://www.sololearn.com/Discuss/2293564/?ref=app
https://www.sololearn.com/Discuss/2307847/?ref=app
https://www.sololearn.com/Discuss/2331835/?ref=app
https://www.sololearn.com/Discuss/2292606/?ref=app
https://www.sololearn.com/Discuss/2280414/?ref=app
https://www.sololearn.com/Discuss/2278069/?ref=app
https://www.sololearn.com/Discuss/2265204/?ref=app
https://www.sololearn.com/Discuss/2259832/?ref=app
https://www.sololearn.com/Discuss/2239999/?ref=app
https://www.sololearn.com/Discuss/2245525/?ref=app
https://www.sololearn.com/Discuss/2252381/?ref=app
https://www.sololearn.com/Discuss/2253396/?ref=app
+ 7
I think in python you can use round() too š©ą¤°ą¤¾ą¤ą¤¾ą¤¬ą¤¾ą¤¬ą„ ą¤¶ą¤¾ą¤¹š®š³
+ 1
Thanks Alot guys.. it worked... I wonder why the round doesn't work though