Python_Grade 7
Python_Grade 7
b. The and logical operator gives true only when both logical tests are true.
e. The continue statement is used to skip the current iteration of a loop and move to the
next iteration.
Ans- The if….else statement allows you to execute different blocks of code based on whether a
condition is true or false. The ‘else ‘ statement is used to execute the code inside it, if the
condition specified is false.
Ans-The pass statement is used to skip over some code for a specific reason. It is a way to tell
the computer to do nothing the computer has to ignore it and move to the next instruction.
Ans-the ‘while’ loop allows to repeat a set of instructions as long as a specific condition remains
true.
The ‘for’ loop is used when we need to repeat the same instructions for each value in a
sequence.
d. Ishaan wants to print the multiplication table of a number using a loop. Which loop will he
select for the same and why?
Ans- The ‘for’ loop is suitable to print the multiplication table of a number because for loop is
suitable to repeat the instruction for each value of a number in table.
Ans-
10
7
4
1
Ans-
1
3
4
5
Ans- x is equal to or less than 5