I made a method and called onto it with super() but I do not know how to write the name of the class in a print statement!
from abc import ABC, abstractmethod
class Clothing(ABC):
@abstractmethod
def desc(self):
pass
class Shirt(Clothing):
def desc(self):
x = input('Enter a color: ')
y = input('Enter the size: ')
print(f"Your {self} is: {x}\nAnd its size is: {y}")
class Jean(Shirt):
def desc(self):
super().desc()
# shirt = Shirt()
# shirt.desc()
jean = Jean()
jean.desc()
I tried printing self, which, while it does kind of return the class name, it has this answer:
Your **<__main__.Jean object at 0x0000023E2C2D7D30>** is: red
And its size is: 32
Btw I started learning like a week ago so please do enlighten me