MapleStory Finger Point

๐Ÿ’Ž Python/Python_Code

๊ตฌ๊ตฌ๋‹จ ํ”„๋กœ๊ทธ๋žจ - ํŒŒ์ด์ฌ for Beginner (2ํŒ)

HYEJU01 2024. 3. 19. 22:57

โœ… ๊ตฌ๊ตฌ๋‹จ ํ”„๋กœ๊ทธ๋žจ 

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)