For some background information, I was trying to familiarise myself with objects, classes and attributes on Python.
class Plane:
def __init__(self,ModelName,brand,capacity):
self.ModelName = ModelName
self.brand = brand
self.capacity = capacity
def intro_plane(self):
print(
"The name of the plane is " + self.ModelName +
". It was released by " + self.brand +
". It has a capacity of " + self.capacity
)
P1 = Plane("B737", "Boeing", 155)
P1.intro_plane()
I ran my code on VsCode and this is the result:
TypeError: can only concatenate str (not "int") to str