반응형
def greet():
print("hi")
print("hi")
print("hi")
greet()
def greet_with_name(name):
print(f"hi {name}")
greet_with_name("TJ")
페인트 면적 구하기
파이썬에서 올림 구할 때 math에서 ceil
#Write your code below this line 👇
import math
def paint_calc(height, width, cover):
result = math.ceil(height * width / cover)
print(f"You'll need {result} 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)
반응형
'파이썬 > exercise' 카테고리의 다른 글
8-3. python caesar cipher (0) | 2023.01.04 |
---|---|
8-2. python prime number checker (0) | 2023.01.04 |
7. python hangmangame (0) | 2023.01.04 |
5-4. python 비밀번호 생성기(shuffle) (0) | 2023.01.04 |
5-3. python 짝수의 합 구하기(for반복문 연습) (0) | 2023.01.04 |