From 8c599927b3c70e918c2869e1d1be11a382fc1c32 Mon Sep 17 00:00:00 2001 From: pythonboi Date: Fri, 3 Sep 2021 05:35:31 -0400 Subject: [PATCH] add function for paint calculation --- Exercise.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Exercise.py b/Exercise.py index 3335033..0db22d6 100644 --- a/Exercise.py +++ b/Exercise.py @@ -27,11 +27,17 @@ def greet(city, name, location): greet(location="canada", name="hafeez", city="Toronto") +import math + # Write your code below this line 👇 def paint_calc(height, width, cover): - numbOfCans = (height * width) / coverage - print(round(numbOfCans)) + numbOfCans = (height * width) / cover + print(numbOfCans) + rand = round(numbOfCans) + ran = math.ceil(numbOfCans) + print(f"You will need {rand} cans of paint") + print(f"You will need {ran} cans of paint") # Write your code above this line 👆