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
1 answer
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'.