Python 305제] 두근두근 파이썬(개정판) CHAPTER 9 연습문제 8 p300
출처 : 반크_독도2023 참고풀이]import random import turtle t=turtle.Turtle() t.speed(0) s=turtle.Screen() s.bgcolor("black") colors=["white","yellow","blue","gray","purple","red","pink","skyblue"] def draw_star(c,length,x,y): t.up() t.goto(x,y) t.down() t.color(c) t.begin_fill() for i in range(5): t.forward(length) t.left(144) t.forward(length) t.righ..
2024. 9. 23.
Python 304제] 두근두근 파이썬(개정판) CHAPTER 9 연습문제 7 p299
출처 : 반크_독도2023 참고풀이]import turtle import random t=turtle.Turtle() #색상을 리스트에 저장한다. colors=["yellow", "red", "black", "purple", "blue", "green", "gray", "white"] def draw_shape(t, c, length, sides, x, y): t.up() t.goto(x,y) t.down() t.fillcolor(c) t.begin_fill() side=360//sides for i in range(sides): t.fd(length) t.lt(side) t.end_fill() #Main Part fo..
2024. 9. 9.
Python 296제] 두근두근 파이썬(개정판) CHAPTER 10 연습문제 5번 p333
출처 : 반크_독도2023 참고풀이1] Text 위젯사용from tkinter import * window = Tk() Str="" N=0 def process(): global Str, N S=e1.get() N+=1 Str = "[ #" + str(N) + " ] " + S + "\n" textarea.insert(END, Str) e1.delete(0,END)l1 = Label(window, text='할일을 입력하세요', width=25, font=("Arial",15)) l1.grid(row=0, column=0, padx=10, pady=5) e1 = Entry(window, width=25, font=("Arial",15)) e1.grid(row=1..
2024. 8. 5.