[Python] 어느 방이 가격 대비 더 넓은가?

·2023년 4월 12일
0

[ Python ]

목록 보기
5/19

✅ 방 A
가로 2.5m, 세로 3m, 월세 27만원

✅ 방 B
가로 4m, 세로 2m, 월세 30만원

def largest(width, height, value):
	size = (width * height) / value
    return size

room_A = largest(2.5, 3.0, 270000)
room_B = largest(4.0, 2.0, 300000)

if room_A > room_B:
    print(f'방A 가 가격 대비 더 넓다.')
else:
    print(f'방B 가 가격 대비 더 넓다.')
profile
https://dribbble.com/ohseyun

0개의 댓글