Car class demo¶
In this notebook, I show you how to get the brand and the number of wheels of a car created.
In [1]:
Copied!
from car import Car
fancy_car = Car(num_of_wheels=6, brand='POSH')
print(f'My fancy {fancy_car.brand} car has {fancy_car.num_of_wheels} wheels')
from car import Car
fancy_car = Car(num_of_wheels=6, brand='POSH')
print(f'My fancy {fancy_car.brand} car has {fancy_car.num_of_wheels} wheels')
My fancy POSH car has 6 wheels
In [10]:
Copied!
import seaborn as sns
sns.barplot(x=['fancy_car.num_of_wheels'], y=[fancy_car.num_of_wheels])
import seaborn as sns
sns.barplot(x=['fancy_car.num_of_wheels'], y=[fancy_car.num_of_wheels])
Out[10]:
<Axes: >