-
[Python] dict 합치기 (merge)Python 2021. 12. 15. 08:34
form = {'city' : city, 's_country':country, 's_room_type':room_type} choices = {'countries':countries, 'room_types':room_types} context = {**form, **choices} print(context) => 'city' : city, 's_country':country, 's_room_type':room_type, 'countries':countries, 'room_types':room_types
'Python' 카테고리의 다른 글
[Python] dotenv 사용하기 (0) 2021.12.16 [Python] dictionary에 여러개의 value를 넣어보자 (0) 2021.12.15 [Python] .join() method 이용해서 간지나게 list 뜯어보기 (0) 2021.12.04 [Python] 함수의 arguments에 함수를 던져보자 (0) 2021.11.25 [Python] 지역변수들이 뭐가 있나 확인해보자 locals() (0) 2021.11.25