Posted on 7th September 2024|30 views
Can we define multiple constructors in python?
I just want to know if is it possible to define various constructors, for example, assume there is a class called sales, and I would like to add somesales = sales() or somesales = sale("MAC") where first is defined give a default name value and second defines it.
Posted on 7th September 2024| views
try this
class Sales():
def_init_(self, sales=none):
pass
somesales = Sales(sales= “MAC”)