โ๏ธ Python Programming/์ด์์ ํ์ด์ฌ์ ์ฒ์์ด์ง!_2019 Ver10 [์ด์์ ํ์ด์ฌ์ ์ฒ์์ด์ง!_2019 Ver] 9์ฅ Lab ๋์ ๋ฌธ์ ํ์ด # 9์ฅ Lab ๋์ ๋ฌธ์ ํ์ด 440p_Lab ๋์ ๋ฌธ์ ) from tkinter import * # ๋ฒํผ์ ์ ํํ ์ ์๋์ง ์ฌ๋ถ ๊ฒ์ฌ --> ์ ํ ๊ฐ๋ฅํ๋ฉด o,x ํ์ def checked(i): global player button = list[i] # ์ฌ์ฉ์๊ฐ ์ ํํ ์ ์๋ ๋ฒํผ์ ๋๋ฅผ ๊ฒฝ์ฐ ์๋ฌด ํ๋๋ ์ทจํ์ง ์๊ณ ๋ฆฌํด if button["text"] != " ": return button["text"] = " " + player + " " button["bg"] = "yellow" if player == "X": button["bg"] = "yellow" else: button["bg"] = "lightgreen" # ์นํจ๊ฐ ๊ฐ๋ ธ๋์ง ํ์ธ if (list[0]["text"] == list[1].. 2023. 2. 22. [์ด์์ ํ์ด์ฌ์ ์ฒ์์ด์ง!_2019 Ver] 8์ฅ Lab ๋์ ๋ฌธ์ ํ์ด # 8์ฅ Lab ๋์ ๋ฌธ์ ํ์ด 371p_Lab ๋์ ๋ฌธ์ ) class Car: def __init__(self, speed=0, gear=1, fuel=0, distance=0, color="white"): self.__speed = speed self.__gear = gear self.__color = color self.__fuel = fuel self.__distance = distance def setSpeed(self, speed): self.__speed = speed def setGear(self, gear): self.__gear = gear def setColor(self, color): self.__color = color def Fuel_efficiency(self, fuel): se.. 2023. 2. 21. [์ด์์ ํ์ด์ฌ์ ์ฒ์์ด์ง!_2019 Ver] 7์ฅ Lab ๋์ ๋ฌธ์ ํ์ด # 7์ฅ Lab ๋์ ๋ฌธ์ ํ์ด 338p_Lab ๋์ ๋ฌธ์ ) phrase = input('๋ฌธ์์ด์ ์ ๋ ฅํ์์ค: ') phrase = phrase.replace("In","") phrase = phrase.replace("The","") phrase = phrase.replace("Of","") phrase = phrase.replace("By","") acro = "" for word in phrase.upper().split(): acro += word[0] print(acro) 2023. 2. 21. [์ด์์ ํ์ด์ฌ์ ์ฒ์์ด์ง!_2019 Ver] 6์ฅ Lab ๋์ ๋ฌธ์ ํ์ด # 6์ฅ Lab ๋์ ๋ฌธ์ ํ์ด 278p_Lab ๋์ ๋ฌธ์ ) def menu_choice(i): if i == 1: print(friends) elif i == 2: name = input('์ด๋ฆ์ ์ ๋ ฅํ์์ค: ') friends.append(name) elif i == 3: del_name = input('์ญ์ ํ ์ด๋ฆ์ ์ ๋ ฅํ์์ค: ') if del_name in friends: friends.remove(del_name) else: print('์ด๋ฆ์ด ์น๊ตฌ ๋ชฉ๋ก์ ์กด์ฌํ์ง ์์ต๋๋ค.') elif i == 4: old_name = input('๋ณ๊ฒฝํ ์ด๋ฆ์ ์ ๋ ฅํ์์ค: ') if old_name in friends: index = friends.index(old_name) new_name = input('.. 2023. 2. 20. [์ด์์ ํ์ด์ฌ์ ์ฒ์์ด์ง!_2019 Ver] 5์ฅ Lab ๋์ ๋ฌธ์ ํ์ด # 5์ฅ Lab ๋์ ๋ฌธ์ ํ์ด 200p_Lab ๋์ ๋ฌธ์ ) def get_fac(n): sum = 1 for i in range(n, 1, -1): sum = sum * i return sum number = int(input('์ซ์๋ฅผ ์ ๋ ฅํ์์ค: ')) final = get_fac(number) print(number, '! = ', final, sep='') 201p_Lab ๋์ ๋ฌธ์ ) def birthday(name): print('\n') print('์์ผ ์ถํํฉ๋๋ค!') print('์์ผ ์ถํํฉ๋๋ค!') print('์ฌ๋ํ๋ ', name, '์', sep='') print('์์ผ ์ถํํฉ๋๋ค!') name_plz = input('์ด๋ฆ: ') birthday(name_plz) 203p_Lab ๋์ ๋ฌธ์ .. 2023. 2. 19. [์ด์์ ํ์ด์ฌ์ ์ฒ์์ด์ง!_2019 Ver] 4์ฅ Lab ๋์ ๋ฌธ์ ํ์ด # 4์ฅ Lab ๋์ ๋ฌธ์ ํ์ด 157p_Lab ๋์ ๋ฌธ์ ) import turtle spi = turtle.Turtle() size = 16 for i in range(50): size = size + 3 spi.forward(size) spi.right(24) 158p_Lab ๋์ ๋ฌธ์ ) import turtle octagon = turtle.Turtle() sides = 8 side_length = 133 angle = 360.0 / sides for i in range(sides): octagon.forward(side_length) octagon.right(angle) 162p_Lab ๋์ ๋ฌธ์ ) import turtle import math # ์ขํ์ถ ๊ทธ๋ฆฌ๊ธฐ line = turtle.Turtle() .. 2023. 2. 18. ์ด์ 1 2 ๋ค์