weight = 78.2
weight
weight = 16.2
print(weight)
weight = 78.2
weight = 76.9
weight
x = 100
y = 200
x, y
x, y = 100, 200
result = x + y
result
s1 = '¾È³çÇϼ¼¿ä!!!'
s1
s1 = 'Hello World!'
len(s1)
s1 = "Hello"
s2 = "World!"
s1 + s2
n1 = 100
n2 = 200
n1 + n2
height = 1.80
weight = 78.2
bmi = weight / height**2
bmi
height = 1.80
weight = 72.8
bmi = weight / height**2
bmi
radius = 80
area = 3.14 * radius**2
print('ÇÇÀÚ ¸éÀûÀº', area)
import turtle
t = turtle.Turtle()
t.shape('turtle')
radius = 100
t.circle(radius) # ¹ÝÁö¸§ÀÌ 100ÀÎ ¿øÀÌ ±×·ÁÁø´Ù.
radius = 200
t.circle(radius) # ¹ÝÁö¸§ÀÌ 200ÀÎ ¿øÀÌ ±×·ÁÁø´Ù.
turtle.done()
try:
turtle.bye()
except:
print("bye")
principal = 10000000
years = 5
interest_rate = 0.03
money = principal * (1.0 + interest_rate) ** years
print('¿ø±Ý: ', principal)
print('ÀÌÀ²: ', interest_rate)
print('±â°£: ', years)
print('¼ö·É±Ý¾×: ', money)
x = 10
x
x = 3.14
x
weight = 78.2
type(weight)
salary = 250
type(salary)
name = "È«±æµ¿"
address = "¼¿ï½Ã Á¾·Î±¸ 1¹øÁö"
type(name)
name = "È«±æµ¿"
address = "¼¿ï½Ã Á¾·Î±¸ 1¹øÁö"
type(address)
b = True
type(b)
x = 10
y = 10
x + y
x = 'good'
y = 'morning!'
x + y
'23' + '56'
23 + 56
0.1 + 0.1 == 0.2
0.1 + 0.1 + 0.1 == 0.3 #¼öÄ¡¿À·ù·Î ÀÎÇØ ¿ì¸®°¡ »ý°¢ÇÑ True°¡ ³ª¿ÀÁö ¾ÊÀ½
0.1 + 0.1 + 0.1 #0.3ÀÌ ¾Æ´Ñ ¹Ì¼¼ÇÑ ¼öÄ¡¿À·ù¸¦ °¡Áø ±Ù»ç°ª
10 ** 100 #10ÀÇ 100½Â
"Hello"
msg = "Hello" # º¯¼ö¸¦ ÀÌ¿ëÇؼ ¹®ÀÚ¿À» ÀúÀåÇÑ´Ù
msg # ¹®ÀÚ¿À» Ãâ·ÂÇÏ¸é ±âº»ÀûÀ¸·Î ÀÛÀº µû¿ÈÇ¥³»¿¡ ¹®ÀÚ°¡ ³ªÅ¸³²
msg = "Hello" # º¯¼ö¸¦ ÀÌ¿ëÇؼ ¹®ÀÚ¿À» ÀúÀåÇÑ´Ù
print(msg) # print()·Î ¹®ÀÚ¿À» Ãâ·ÂÇÏ¸é µû¿ÈÇ¥´Â ³ªÅ¸³ªÁö ¾ÊÀ½
msg = "Hello'
msg = "Hello
msg = "Hello"
message="ö¼ö°¡ "¾È³ç"À̶ó°í ¸»Çß½À´Ï´Ù."
message = 'ö¼ö°¡ "¾È³ç"À̶ó°í ¸»Çß½À´Ï´Ù.'
message
message = 'ö¼ö°¡ "¾È³ç"À̶ó°í ¸»Çß½À´Ï´Ù.'
print(message)
print('ö¼ö°¡ \'¾È³ç\'À̶ó°í ¸»Çß½À´Ï´Ù.')
print('¾È³ç\n¿ì¸® ´Ù½Ã ¸¸³ª~~')
print('¾È³ç\t¿ì¸® ´Ù½Ã ¸¸³ª~~')
'100' + '¿ø'
str(100) + '¿ø' # str() ÇÔ¼ö´Â 100À» ¹®ÀÚ¿ '100'À¸·Î º¯È¯½ÃÅ´
str(100)
int("100")
str(3.14)
float("3.14")
name = input("À̸§À» ÀÔ·ÂÇϽÿÀ: ")
name = input("À̸§À» ÀÔ·ÂÇϽÿÀ: ")
print(name, "¾¾, ¾È³çÇϼ¼¿ä?")
print("ÆÄÀ̽ã ÇÁ·Î±×·¡¹ÖÀÇ ¼¼°è¿¡ ¿À½Å °ÍÀ» ȯ¿µÇÕ´Ï´Ù.")
x = int(input("ù ¹ø° Á¤¼ö¸¦ ÀÔ·ÂÇϽÿÀ: "))
y = int(input("µÎ ¹ø° Á¤¼ö¸¦ ÀÔ·ÂÇϽÿÀ: "))
s = x + y
print(x, "°ú", y, "ÀÇ ÇÕÀº", s, "ÀÔ´Ï´Ù.")
# »ç¿ëÀÚÀÇ ´ë´äÀ» º¯¼ö¿¡ ÀúÀåÇÑ´Ù.
stadium = input("°æ±âÀåÀº ¾îµðÀԴϱî? ")
winner = input("À̱ä ÆÀÀº ¾îµðÀԴϱî? ")
loser = input("Áø ÆÀÀº ¾îµðÀԴϱî? ")
vip = input("¿ì¼ö¼±¼ö´Â ´©±¸ÀԴϱî? ")
score = input("½ºÄÚ¾î´Â ¸î´ë¸îÀԴϱî? ")
# »ç¿ëÀÚÀÇ ÀÔ·ÂÀ» ¹ÙÅÁÀ¸·Î ±â»ç¸¦ ÀÛ¼ºÇÑ´Ù.
print("")
print("===========================================")
print("¿À´Ã", stadium, "¿¡¼ ¾ß±¸ °æ±â°¡ ¿·È½À´Ï´Ù.")
print(winner, "°ú", loser, "Àº Ä¡¿ÇÑ °ø¹æÀüÀ» ÆîÃƽÀ´Ï´Ù.")
print(vip, "ÀÇ ¸ÍÈ°¾àÀ¸·Î ", winner,"°¡", loser,"¸¦ ", score,"·Î ÀÌ°å½À´Ï´Ù.")
print("===========================================")
street = "¼¿ï½Ã ¼ººÏ±¸"
type = "¿ÀÇǽºÅÚ"
number_of_rooms = 1
price = 70000000
print("###############################")
print("# #")
print("# ºÎµ¿»ê ¸Å¹° ±¤°í #")
print("# #")
print("###############################")
print("")
print(street, "¿¡ À§Ä¡ÇÑ ¾ÆÁÖ ÁÁÀº ", type, "°¡ ¸Å¹°·Î ³ª¿Ô½À´Ï´Ù. ÀÌ ",
type, "´Â ", number_of_rooms, "°³ÀÇ ¹æÀ» °¡Áö°í ÀÖÀ¸¸ç °¡°ÝÀº",
price, "ÀÔ´Ï´Ù.")