在学习面向对象的跨类调用时遇到了一些问题
```python
class Peason():
def __init__(self, name):
self.name = name
def go_to(self, place, vehice):
self.place = place
self.vehice = vehice
vehice.run()
print(f"{self.name}驾驶{self.vehice.brand}{self.vehice}去{self.place}")
class Car():
def __init__(self, brand):
self.brand = brand
def run(self):
print("行驶")
lz = Peason("老张")
car = Car("奔驰")
lz.go_to("东北", "车")
######
```python
Traceback (most recent call last):
File "/home/tarena/month01/day10/exercise2.py", line 55, in <module>
lz.go_to("东北", "车")
File "/home/tarena/month01/day10/exercise2.py", line 41, in go_to
vehice.run()
AttributeError: 'str' object has no attribute 'run'
我尝试过在变量vehice前面加self 但是依然没有解决,还是会报相同的错
######正确赋值,并且能输出我想要的语句