λ³Έλ¬Έ λ°”λ‘œκ°€κΈ°

βœ’οΈ 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.