if....else is a type of -
sequential statements conditional statements
iterative statements None of these
Answers
The boolean expression after the if statement is called the condition. If it is true, then all the indented statements get executed. What happens if the condition is false, and food is not equal to 'spam'? In a simple if statement like this, nothing happens, and the program continues on to the next statement.
The indented statements that follow are called a block. The first unindented statement marks the end of the block. Each statement inside the block must have the same indentation.
The boolean expression after the if statement is called the condition. If it is true, then all the indented statements get executed. What happens if the condition is false, and food is not equal to 'spam'? In a simple if statement like this, nothing happens, and the program continues on to the next statement.
The indented statements that follow are called a block. The first unindented statement marks the end of the block. Each statement inside the block must have the same indentation.