Dictionary 辞書の定義

ソースコード
                    #coding:utf-8
                    #連想配列、辞書(Dictionary)2025/1/29
                    #key:value-→item
                    #キーと値
                    import os
                    os.system('clear')
                    #辞書の定義
                    cars = {
                        "maker":"TOYOTA",
                        "model":"SUV",
                        "year":2023,
                        "price":2300000,
                        "color":["Rose","Black","White","Red"]
                    }
                    
                    print(type(cars),cars["model"])
                    print(f'アイテムの数は{len(cars)}です')
                    
                    #辞書アイテムのアクセス item access
                    
                    x = cars["maker"]
                    print(x)
                    y = cars.get("maker")
                    print(y)
                    z = cars.keys()
                    print(z)
                    
                    cars["price"] = 2150000
                    print(cars)
                    
                    cars.pop("year")
                    print(cars)

                
実行結果