1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | # # µû¶óÇÏ¸ç ¹è¿ì´Â ÆÄÀ̽ã°ú µ¥ÀÌÅÍ°úÇÐ(»ý´ÉÃâÆÇ»ç 2020) # LAB 4-9 ÀÔ·ÂÀ» ¹Þ¾Æ¼ µµÇü ±×¸®±â¸¦ Çغ¸ÀÚ, 111ÂÊ # import turtle t = turtle.Turtle() t.shape("turtle") s = turtle.textinput("", "µµÇüÀ» ÀÔ·ÂÇϽÿÀ: ") if s == "»ç°¢Çü" : # »ç¿ëÀÚ°¡ »ç°¢ÇüÀ» ÀÔ·ÂÇÑ °æ¿ì °¡·Î, ¼¼·Î¸¦ ¹°¾îº»´Ù s = turtle.textinput("", "°¡·Î: ") w = int(s) s = turtle.textinput("", "¼¼·Î: ") h = int(s) t.forward(w) t.left(90) t.forward(h) t.left(90) t.forward(w) t.left(90) t.forward(h) # À̵ »ï°¢Çü elif s == "»ï°¢Çü": s = turtle.textinput("", "¹Øº¯: ") w = int(s) s = turtle.textinput("", "³ôÀÌ: ") h = int(s) t.forward(w) t.goto(w / 2, h) t.goto(0, 0) # Á¤»ï°¢Çü # elif s == "»ï°¢Çü": # s = turtle.textinput("", "¹Øº¯: ") # w = int(s) # t.forward(w) # t.left(120) # t.forward(w) # t.left(120) # t.forward(w) elif s == "¿ø": s = turtle.textinput("", "¹ÝÁö¸§: ") r = int(s) t.circle(r) turtle.done() | cs |