jm_p_op
.py dictionary를 class에 넣기 , ** 언어 본문
class Station:
def __init__(self,**station):
self.id=station.get('id')
self.title=station.get('title')
self.author=station.get('author')
self.content=station.get('content')
stat={'id': "id값",
'title':"title값",
'author':"author값",
'content':"content값"}
a=Station(**stat)
print(a.id)
'py' 카테고리의 다른 글
.py Truthy&Falsy (if type) (0) | 2023.04.05 |
---|---|
.py try문과 class-object와 funtion 사이에 일어나는 일(실험실) (0) | 2023.04.04 |
.py class와 dictionary 불러오는 방식 (0) | 2023.04.03 |
.py 키도드 입력 keyboard (0) | 2023.03.31 |
.py 실시간 키보드 입력 , (0) | 2023.03.31 |