Posts
Q&A
ํ๊ณ ๋ง๋ค๊ธฐ ๊ธฐ๋ฅ์ด ์๋ณด์ด๋๋ฐ ํน์ ์ด๋ป๊ฒ ํ๋ฉด๋ ๊น์??
์ฐ๋ ๋์ด์๋๋ฐ ์์ฑ์ด ์๋์ ๋ฌธ์ ๋๋ ธ๋๋ฐ ์๋ก์ด ์คํฌ๋ผ์ ์์ฑํ๋ ๊ฐ์๊ธฐ ์์ฑ์ด ๋๋ค์. ํน์ ๋ค๋ฅธ๋ถ๋ค๋ ๊ฐ์ ์ฆ์ ๊ฒช์ผ์ค๊น๋ด ์ง๋ฌธ ์ญ์ ์ํ๊ณ ๋จ๊ฒจ๋๊ฒ ์ต๋๋ค.
- Likes
- 1
- Comments
- 2
- Viewcount
- 266
Q&A
logout์ ํ์ง๋ง ์ธ์ ์ด ๋จ์์์ต๋๋ค.
์ฐพ๋ค๋ณด๋ ๋ต์ ์ด๋ฏธ ์ ์ด ๋์ผ์ จ๋ค์. ๋ค๋ฅธ๋ถ๋ค ์ฝ์งํ์ค๊น๋ด ๋งํฌ ๊ฑธ์ด ๋ก๋๋ค.https://www.inflearn.com/questions/40072/%EB%8F%99%EC%8B%9C-%EC%84%B8%EC%85%98-%EC%A0%9C%EC%96%B4-%EB%8F%99%EC%9D%BC-%EB%B8%8C%EB%9D%BC%EC%9A%B0%EC%A0%80%EC%97%90%EC%84%9C-%EB%A1%9C%EA%B7%B8%EC%95%84%EC%9B%83%EC%9D%B4-%EC%A0%95%EC%B1%85-%EB%AF%B8%EC%A0%81%EC%9A%A9
- Likes
- 0
- Comments
- 1
- Viewcount
- 1.1K
Q&A
์ค๋ฌด์์ ์ฌ์ฉ๋๋ Setter
์กฐ๊ธ ์๋ก ์ ์ธ ๋ด์ฉ์ด๊ธด ํ๋ฐ ๋์์ด ๋์์ผ๋ฉด ํด์ ๋๊ธ์ ๋ฌ์ ๋ด ๋๋ค. ์ค๋ฌด์์๋ ์ค์ ๋ก ์ด๋ค ๊ฐ์ฒด์ ๊ฐ์ด ์์ ๊ฒฝ์ฐ, ๊ทธ ๊ฐ์ด DB์์ ๋ฐํ๋ ๊ฐ์ธ์ง ์ค๊ฐ์ ๋ณ๊ฒฝ๋ ๊ฐ์ธ์ง ๋ก์ง์ด ๋ณต์กํ๋ฉด ๋ณ๊ฒฝ๋์ง ์์๋ค๋ ์ฌ์ค์ ๋ณด์ฅํ๊ธฐ ์ฝ์ง ์์ต๋๋ค. ๋๋ฌธ์ setter๋ฅผ ํ์ํ ๋๋ง ๋๋ค๋ฉด ๊ฐ์ด ๋ณ๊ฒฝ๋์ง ์์๋ค๋ ์ฌ์ค์ ๋ณด์ฅ๋ฐ์์ ์์ต๋๋ค. (๋์์ธ ํจํด์ ํตํด ๋ณด์ฅ์ ํ๊ธฐ๋ ํ์ง๋ง ๊ฒฐ๋ก ์ ๋ณ๊ฒฝ์ ๋ถ๊ฐํ๊ฒ ํ๋ ๊ฒ์ ๋๋ค.)
- Likes
- 0
- Comments
- 2
- Viewcount
- 423
Q&A
์ค๋ฅ๊ฐ ๋จ๋ค์
practice.py๋ travel ๋๋ ํ ๋ฆฌ์ ๊ฐ์ ๋ ๋ฒจ์ ์์น์ ์์ด์ผ ํฉ๋๋ค.
- Likes
- 0
- Comments
- 1
- Viewcount
- 418
Q&A
์ค๊ฐ๊ฐ์๋ง default ๊ฐ์ ์ค์ ํ ์๋ ์์๊น์?
์๋์ ๊ธ์ด ๋์์ด ๋ ๊ฒ ๊ฐ๋ค์ https://velog.io/@swhybein/WC6-day2-python-%ED%95%A8%EC%88%98-%EC%A0%95%EC%9D%98-%EA%B4%80%EB%A0%A8
- Likes
- 1
- Comments
- 1
- Viewcount
- 242
Q&A
์๋ ํ์ธ์! Quiz8 ์ฝ๋๋ถ๋ถ์ค์ ๊ถ๊ธํ๊ฒ์ด ์์ต๋๋ค!!
์ฌ์ฉํ๋ ์ชฝ์์ ์ฌ์ฉํ์ง ์๊ณ ์์ฑ๋ง ํด์ ์ฐ๋ ค๋ฉด ์๋์ ๊ฐ์ด ์ฐ๋ฉด ๋ฉ๋๋ค. class House: houseList = [] # ์ด๊ธฐํ def __init__(self , location , house_type , deal_type , price ,completion_year): self.location = location self.house_type = house_type self.deal_type = deal_type self.price = price self.completion_year = completion_year self.houseList.append(self) # ๋ฉ๋ฌผ ์ ๋ณด ํ์ def show_detail(self): print("์ด {0}๊ฐ์ ๋งค๋ฌผ์ด ์์ต๋๋ค.".format(len(House.houseList))) for house in House.houseList: print(house.location , house.house_type , house.deal_type ,\ house.price ,house.completion_year) h = House("๊ฐ๋จ","์ํํธ","๋งค๋งค","10์ต","2010๋ ") h = House("๋งํฌ","์คํผ์คํ ","์ ์ธ","5์ต","2007๋ ") h = House("์กํ","๋น๋ผ","์์ธ","500/50","2007๋ ") h.show_detail()
- Likes
- 0
- Comments
- 2
- Viewcount
- 317
Q&A
๋งค๊ฐ๋ณ์์ ํ๋ผ๋ฏธํฐ๋ ์ด๋ป๊ฒ ๋ค๋ฅธ๊ฐ์?
๋ฐ๋ผ๋ณด๋ ์ ์ฅ์์์ ์ฉ์ด ์ฐจ์ด์ ๋๋ค. ๋ณ์๋ฅผ ํ ๋น ๋ฐ๋ ํด๋์ค ์ ์ฅ์์ ๋ณด๋ฉด ()์์ ๋ณ์๋ 'ํ๋ผ๋ฏธํฐ' ๋ณ์๋ฅผ ๋ณด๋ด์ฃผ๋ ์ ์ฅ์์ ()์ ๋ณ์๋ '์๊ท๋จผํธ' ๋ผ๊ณ ํํํฉ๋๋ค.
- Likes
- 1
- Comments
- 3
- Viewcount
- 495
Q&A
์ง๋ฌธ์ด ์์ต๋๋ค.
1. ์๋ง ๋ฉ๋ชจ๋ฆฌ ์ฃผ์๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ด๋ผ, ์์ฑ๋ณด๋ค๋ ๊ฐ๋ฅดํจ๋ค๋ ํํ์ด ๋ง์๊ป๋๋ค. ํ์ง๋ง ๊ทธ๋ฐ ์์ผ๋ก ๊ด๋ฆฌํ๋ฉด ๋์ค์ ๊ฐ์ฒด ๊ด๋ฆฌ๊ฐ ํ๋ค์ด ์ง๋๋ค. 2.๋ค ์๋๋ ๊ฐ๋จํ ์์ ์ ๋๋ค. class ParentA: def __init__(self , name): self.name = name def whois(self): print("my name is {0} ".format(self.name)) class ChildA(ParentA): def __init__(self , name): self.name = name def whois(self): print("my parent name is {0} ".format(self.name)) parentA = ParentA("A") parentA.whois() # my name is A childA = ChildA("A") childA.whois() # my parent name is A
- Likes
- 1
- Comments
- 1
- Viewcount
- 215
Q&A
if not
if line != null ์ด ์๋๊ณ if line == null ์๋๊ฐ์?
- Likes
- 0
- Comments
- 2
- Viewcount
- 768
Q&A
input์ type์ด ๋ฌธ์ํ์ด๊ธฐ ๋๋ฌธ์ str์ฐ์ง ์์๋ ๋๋ค๊ณ ํ์ จ๋๋ฐ์
temp = int(input("๊ธฐ์จ์ ์ด๋์?") ) ๋ฌธ์์ด > ์ซ์ answer = input("๊ธฐ์จ์ ์ด๋์?") ๋ฌธ์์ด print ํจ์ ์์๋ ๋ฌธ์์ด ํ์ ๋ง ๋ค์ด๊ฐ๊ธฐ ๋๋ฌธ์ ์ซ์๋ ๋ฌธ์๋ก ๋ณํ(ํ์ฑ์ด๋ผ๊ณ ๋ ํฉ๋๋ค)ํด์ print ํจ์์์ ๋ฃ์ด์ผ ํ๋๊ฑฐ ๊ฐ๋ค์ ์๋ ์ซ์๋ก ๋ฃ์์ ํธ์ถ๋๋ ์๋ฌ๋ฅผ ์ฒจ๋ถํด ๋๋ฆฝ๋๋ค. Exception has occurred: TypeError can only concatenate str (not "int") to str
- Likes
- 1
- Comments
- 1
- Viewcount
- 235




