If else in Python
An “if else in Python” works irrespective of what the expression’s value is. If the outcome is true then the code block that is succeeding the expression would get executed. If not, the code under the else block will run.
Decision-making is needed in Python to execute code only if a particular condition is fulfilled. The if-else statement is applied in Python for decision-making.
amount = int(input(“Enter amount: “))
discount = amount*0.05
discount = amount*0.10
print (“Net payable:”,amount-discount)