Test/Python(20220101~)

Day8_페인트 면적 계산 (Function)

kiostory 2022. 1. 9. 15:45
#math 모듈, ceil (round,ceil, floor,trunc)
#Write your code below this line ?
import math
def paint_calc(height, width, cover):
    cal_paint=int(math.ceil(height*width/cover))
    print(f"You\'ll need {cal_paint} cans of paint.")
#Write your code above this line ?
# Define a function called paint_calc() so that the code below works.   
# ? Don't change the code below ?
test_h = int(input("Height of wall: "))
test_w = int(input("Width of wall: "))
coverage = 5
paint_calc(height=test_h, width=test_w, cover=coverage)