In python "." What's the difference between operation, ['attr'] operation, get (' attr')

a = {"name":" zzzz"}

a.name = "yuioi" / / error
a [" name"] = "asdasd"

Why "." Operation will report an error

Mar.03,2021

AttributeError: 'dict' object has no attribute' name'
you confuse the concepts of attributes of class objects with dictionary data structures.

first of all, the Dict class does not have the attribute name. So you can't dict.name. However, as a data structure, you can think of 'name'' as a kind of index, similar to array a [0], a [3] index, then you can get the corresponding value

through dict ['name'].
Menu