2장 연습문제

윤영채·2022년 8월 14일

1주차

목록 보기
9/9

문제1

su = 5
dan = 800
print("su 주소 : ",id(su))
print("dan 주소 : ",id(dan))
price = int(su)*int(dan)
print("금액 =",price)

문제2

import math

x = int(2)
y = 2.5*x**2 +3.3*x + 6
print("2차 방정식 결과 =",y)

문제3

import math
fat = int(input("지방의 그램을 입력하세요 : "))
carbo = int(input("탄수화물의 그램을 입력하세요 : "))
protein = int(input("단백질의 그램을 입력하세요 : "))

total = str(fat*9 + carbo*4 + protein*4)
print("총칼로리 : ",total[:1],",",total[1:],end=" cal")

0개의 댓글