Differentciate between 'if' and 'if...else' statements in python
Answers
Answer:
The if statement consists of expressions. An expression can contain values, operators, constants or variables. If the evaluated expression is true, then the statements inside the if block execute. If the expression is false the control is passed to the very next statement after the if block. Most programming languages assume non-zero and non-null values as true and zero as false
In if else, there are two blocks. The if statement contains an expression to evaluate. If the evaluated expression is true, then the statements inside the if block execute. At the end of the if block, the control is passed to the very next statement after the if block. If the expression is false, the control is passed to the else block and the statements of the else block execute. At the end of the else block, the control is passed to the next statement after the else block
Answer. The if statement doesn't have else part means in if statement it will only specify that it is true or false. But in if else statement if the statement is false then it is specified in else part
plz mark o brainlist