COMPUTER SCIENCE AND ENGINEERING
ALGORITHMS
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
|
:
|
|
;
|
|
.
|
|
,
|
Detailed explanation-1: -Explanation: We have to use the semicolon to declare the function in line 3. This is called a function declaration and a function declaration ends with a semicolon.
Detailed explanation-2: -You start the while loop by using the while keyword. Then, you add a condition which will be a Boolean expression. A Boolean expression is an expression that evaluates to either True or False . The condition is followed by a colon, : .
Detailed explanation-3: -Repeated execution of a set of statements is called iteration. Python has two statements for iteration – the for statement, which we met last chapter, and the while statement.
Detailed explanation-4: -You can put a for loop inside an if statement using a technique called a nested control flow. This is the process of putting a control statement inside of another control statement to execute an action. You can put an if statements inside for loops.