Halloween Candy +10 XP You go trick or treating with a friend and all but three of the houses that you visit are giving out candy. One house that you visit is giving out toothbrushes and two houses are giving out dollar bills. Task Given the input of the total number of houses that you visited, what is the percentage chance that one random item pulled from your bag is a dollar bill? Input Format An integer (>=3) representing the total number of houses that you visited. Output Format A percentage value rounded up to the nearest whole number. Sample Input 4 Sample Output 50 my code: from math import * houses = int(input()) if houses>=3: a=((2/houses)*100) print(int(round(a)))

5/16/2020 5:22:40 AM

Akshat Jain5 Answers

New AnswerIn Output it says the result should be rounded *up* to the next integer. You round mathematically.

Hot Today

I am learning python and I have to solve this problem... Please help me
HELP how can i open and read from files on android
HELP WITH HTML DRAWER MENU
A alguien le han modificado su lista de códigos?
A lot of cell phones have tip calculators. Write one. Ask the user for the price of the meal and the percent tip they want to le
In this following i have been already solved but it show three all three results but i need only last one so help me someone.
what is the difference between the following statements
How to print perfect triangle of numbers 1 to 100 ?
Please help me in HTML
I need help fixing my bmi calculator (Solved!)

Sololearn Inc.

535 Mission Street, Suite 1591San Francisco, CA 94105

Â© 2022 Sololearn, Inc.

Send us a message