StudenteCare mission is to give people the power to build educational community and bring the Educators, Students, Parents, Consultant, University, Colleges, Schools and Coachings closer together Ncert Solution | Ncert Solution for class 11th | Ncert Solutions for class 11 Computer Science Python | NCERT COMPUTER SCIENCE PYTHON CHAPTER 11 CONDITIONAL AND LOOPING CONSTRUCTS
 Files Overall Price: 0.00 Videos Overall Price: 0.00 Total Overall Price: 0 Sold By: Pooja Singla

## NCERT Solutions for Class 11 Computer Science (Python) Chapter 11 Conditional and Looping Constructs

Ncert solutions for class 11 Computer Science Python Chapter 11 Conditional and Looping Constructs are prepared by CBSE student eCARE expert to score good marks in class 11. Classes 11 Computer Science Python Chapter 11 Conditional and Looping Constructs contain many topics which are very important to score good in class 11. There are some important topic mentioned below:

Question 1:
What is a statement ? What is the significance of an empty statement ?
A statement is an instruction given to the computer to perform any kind of action.
An empty statement is useful in situations where the code requires a statement but does not require logic. To fill these two requirements simultaneously, empty statement is used. Python offers ‘pass’ statement as an empty statement.

Question 2:
What is the difference between determinable loop and non-determinable loop ?
The ‘for loop’ can be labelled as ‘determinable
Ans. Value of expression is 100 Good bye!
loop’ as number of its iterations can be determined before-hand as the size of the sequence, it is operating upon.
The ‘while loop’ can be ‘non-determined loop’ as its number of iterations cannot be determined before-hand. Its iterations depend upon the result of a test-condition, which cannot be determined before-hand.

Question 3:
What are the two types of else clause in Python ? Ans. The two types of Python else clauses are :
(i)  else in an if statement
(ii) else in a loop statement
The else clause of an if statement is executed when the condition of the if statement results into false.
The else clause of a loop is executed when the loop is terminating normally i.e. when its test-condition has gone false for a while loop or when the for loop has executed the last value in sequence.

Question 4:
Explain nested if…. else.
There may be a situation when you want to check for another condition after a condition resolves to true. In such a situation, you can use the nested if construct. In a nested if construct, you can have an if…elif…else construct inside another if…elif… else construct

Question 5:
Write the syntax of a for loop and also given an example.
The syntax of a for loop looks as follows : for iterating_var in sequence: statements(s)
Example : for i in range (4):
print i
output : 0 1 2 3

Question 6:
What do you mean by “for loop” ?
A for loop is à Python statement which repeats a group of statements a specified number of times. You can use any object (such as strings, arrays, lists, tuples, diet and so on) in a for loop in Python.

## Some questions are asked by class 11 students related to Computer Science (Python)

Question 1:
Why do we use ‘break’ statement ?
The ‘break’ statement can be used to terminate the loop.

Question 2:
What gets printed with the following code ?
x = True
y = False
z = False
if x or y and z :
print “yes”
else:
print “no
Yes

Question 3:
What gets printed with the following code ?
x = True
y = False
z = False
if not x or y :
print 1
elif not x or not y and z:
print 2
elif not x or y or not y and x:
print 3
else:
print 4
3

Question 4:
What gets printed with given code ?
f = None
for i in range (5):
with open(“data.txt”, “w”) as f:
if i > 2:
break
print f.closed
True

Question 5:
Which numbers are printed?
for i in range(2):
print i
for i in range(4,6):
print i
0,1,4, 5

Question 6:
What gets printed?
import re
sum = 0
pattern = ‘back’
if re.match(pattern, ‘backup.txt’):
sum + = 1
if re.match(pattern, ‘text.back’):
sum + = 2
if re.search(pattern, ‘backup.txt’):
sum + = 4
if re.search(pattern, ‘text.back’):
sum + = 8
print sum
13

Question 7:
Write the syntax of an ’if statement1 in Python programming language
if expression :
statement(s)

Question 8:
Write the syntax of an if…..else statement in Python programming language
if expression:
statement(s)
else:
statement(s)

Question 9:
Write the output
#!/usr/bin/python
var =100
if(var==100):
print “Value of expression is 100”
print “Good bye!
Value of expression is 100
Good bye

Question 10:
Define while loops.
A while loop statement in Python programming language repeatedly executes a target statement as long as a given condition is true.

Question 11:
Write the syntax of a while loop.
The syntax of a while loop in Python programming language is :
while expression :
statement(s)

Question 12:
What happened when the condition of while loop becomes false ?
When the condition becomes false, program control passes to the line immediately following the loop.

Question 13:
Write the syntax of a for loop.
The syntax of a for loop look is as follows:
for iterating_var in sequence :
statements(s)

Question 14:
What do you mean by “continue statement” ?
It causes the loop to skip the remainder of its body and immediately retest its condition prior to reiterating.

Question 15:
What do you mean by “pass statement” ?