I need to force function inputs to take specific values. Without writing if, else blocks inside the function, is there any way to specify certain inputs beforehand ?
def product(product_type = ['apple','banana']):
print(product_type)
But the function requires product_type as single string (product('apple') or product('banana')), and gives error when typed different values.