โ ๊ตฌ๊ตฌ๋จ ํ๋ก๊ทธ๋จ
i,sum = 0, 0
dan = 0
dan = int(input("๋จ์ ์
๋ ฅํ์ธ์"))
for i in range(1, 10, 1):
sum = dan * i
print ("๊ตฌ๊ตฌ๋จ %d x %d = %d" % (dan,i,sum))
โ ๊ตฌ๊ตฌ๋จ ํ๋ก๊ทธ๋จ ๊ฑฐ๊พธ๋ก ์ถ๋ ฅ
i,sum = 0, 0
dan = 0
dan = int(input("๋จ์ ์
๋ ฅํ์ธ์"))
for i in range(9, 0, -1):
sum = dan * i
print ("๊ตฌ๊ตฌ๋จ %d x %d = %d" % (dan,i,sum))
โ ๊ตฌ๊ตฌ๋จ ํ๋ก๊ทธ๋จ
i,k=0,0
for i in range (2,10,1) :
for k in range (1,10,1) :
print(" %dx %d = %d" %(i,k,i*k) )
โ ๊ตฌ๊ตฌ๋จ ํ๋ก๊ทธ๋จ (๊ฐ๋จ ์ ๋ชฉ ์ถ๋ ฅ
i,k=0,0
for i in range (2,10,1) :
print("%d ๋จ *** " % i)
for k in range (1,10,1) :
print(" %dx %d = %d" %(i,k,i*k))
print("")
โ ๊ตฌ๊ตฌ๋จ ํ๋ก๊ทธ๋จ (ํ๋ฒ์ ์ถ๋ ฅ
i,k,gugu=0,0,""
for i in range(2,10) :
gugu += (" # %d ๋จ# "%i)
print(gugu)
for i in range (1,10) :
gugu = ""
for k in range (2,10) :
gugu+=str("%2d X%2d=%2d" %(k,i,i*k))
print(gugu)
โ ๊ตฌ๊ตฌ๋จ ํ๋ก๊ทธ๋จ (ํ๋ฒ์ ๊ฑฐ๊พธ๋ก ์ถ๋ ฅ
i,k,gugu=0,0,""
for i in range(9,1,-1) :
gugu += (" # %d ๋จ# "%i)
print(gugu)
for i in range (9, 0 , -1) :
gugu = ""
for k in range (9,1,-1) :
gugu+=str("%2d X%2d=%2d" %(k,i,i*k))
print(gugu)