def_discount_voucher(voucher, amount)

discount = 0
if voucher == 'Flat 50':
discount = 0.5 * amount
elif voucher == 'Flat 30':
discount = 0.3 * amount
elif voucher == 'Flat 20':
discount = 0.2 * amount
return discount

disc = discount_on_voucher('Flat 75', 1000)
print(f'Discount is{disc}')
What will be the output of the code

The output of the code will be an error because there is a typo in the function call. The function is defined as 'def_discount_voucher' but it is called as 'discount_on_voucher'.

The output of the code will be:

"NameError: name 'discount_on_voucher' is not defined"

There is a typo in the function name. It should be "def_discount_voucher" instead of "discount_on_voucher".

The output of the code will be:

Discount is 0

The reason for this is because the voucher passed to the `def_discount_voucher` function is 'Flat 75', which does not match any of the voucher options ('Flat 50', 'Flat 30', 'Flat 20') in the function. Therefore, the discount remains at 0, which is the default value set at the beginning of the function.