For example I have a pydantic model, like this:
class Person:
   name:str
   age: int
   city: str
With pydantic we can get the value by using: P1.name -for example P1 already exists as an instance-
My question is that I have a P1 and I have a string.
P1 = People[name='Steve', age=22, city='New York']
data = "city"
How can I get the field named city with that data string, which will return New York?
 
    