The way I like to access stuff from dictionaries is like this shop_items["Engine"]["Cost"]
This will return the 30 in your code.
I think get() on a Dictionary is only more useful in some cases because it returns null rather than throwing an error if a key is missing. In my opinion I’d rather have an error thrown if my Dictionary isn’t setup right or isn’t being accessed right.
Here is an example how you can work with Dictionaries and how you can iterate over one.
func _ready() -> void:
# get values
print(shop_items["Engine"]["Ignition Coils"]["cost"])
print(shop_items["Brakes"]["Cylinder"]["wear"])
# Iterate
for items in shop_items:
print(items, shop_items[items])
for part_func in shop_items[items]:
print(part_func,shop_items[items][part_func])
for properties in shop_items[items][part_func]:
print(properties, " ", shop_items[items][part_func][properties])