티스토리 뷰

#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)

'Test > Python(20220101~)' 카테고리의 다른 글

Day8_Caesar 암호 1단계, encoding  (0) 2022.01.09
Day8_Prime Number(소수) 감별  (0) 2022.01.09
Day8_입력값이 있는 함수  (0) 2022.01.09
Day7_Hangman Game2  (0) 2022.01.08
Day7_Hangman Game  (0) 2022.01.08
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/08   »
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
글 보관함