How do you create a function whose arguments accepts 2 or even more data types. I have a Product class as follows
class Product:
def __init__(self, name: str, price: int | float)
self.product = {'name': name, 'price': price)
This results into a TypeError
TypeError: unsupported operand type(s) for |: 'type' and 'type'
Then I try using or operator, but it picks up type int only
How can I make sure that it accepts both int and float