콘솔워크

Dictionary 기본 본문

프로그래밍/python

Dictionary 기본

이휘재123 2022. 10. 27. 14:40
반응형
key = "hi"
value = "안녕"

# 출력결과 >> hi 안녕
print(f"{key} {value}")

dict_hello = {}
dict_hello[key] = value

# 출력결과 >> {'hi': '안녕'}
print(dict_hello)

# 출력결과 >> 안녕
print(dict_hello["hi"])

key와 value를 넣고 key로 호출하는 법

반응형