XI - CH-3, Conditional and Looping Construct (Assign)
XI - CH-3, Conditional and Looping Construct (Assign)
n,x=3,4
if n+x==4 :
print("welcome")
elif n+x==7:
print("thank you")
else :
print("bye bye")
a) 30 31 32 33 34 35 c) 30 31 32 33 34
b) 30 31 32 33 d) 30 31 32 34
a) 30 31 32 33 34 35 c) 30 31 32 33 34
b) 30 31 32 33 d) 30 31 32 34
a) 20 15 10 c) 20 10 5
b) 20 15 10 5 d) None
a) 10 11 12 c) 10 11 12 13
b) 10 d) 10 11
a) 10 8 6 c) 10 8
b) 10 9 8 7 d) 10 9 8
25) What is the output of the following code
for i in range (-100, 100, 100 ):
print(i , end=" ")
30) A loop may contain another loop as a part of its body. This loop inside a loop is
called_______
a) while loop b) for loop c) Nested loop d) Infinite loop
35) The loop that reptition of a set of statement depending upon a condition test
a) while loop b) for loop c) Nested loop d) Infinite loop
ByeBye
hello
Short Answer
1. What is an Algorithm ?
2. What is flowchart ? What are different types of symbols used in flowchart
3. Draw a flowchart to find bigger number among two numbers (selective)
4. Draw a flow chart to find factorial of any number. N=5
5. What is statement ? How many types of statement are there?
6. What is pass statement ? What its significance?
7. What is the difference between expression and a statement ?
8. What is a block in PYTHON? How is indentation related to it?
9. What are iteration statements? Name the two iteration statement provided by the PYTHON.
10. What is the syntax of for loop? Explain with example?
11. Define entry controlled loop in python ? Explain with example?
12. What is the difference between for and while loop?
13. What are jump statements? Name them?
14. Explain break with example?
15. Explain continue with example?
16. Find the value generated
a) for i in range (6)
b) for i in range (3, 7)
c) for i in range (5, 15, 3)
d) for i in range (9, 3, -1)
e) for i in range (10 , 1 ,-2)
Short Answer
1. What is an Algorithm ?
An Algorithm is a step –by- step procedure to solve a given problem.
’
4. Draw a flow chart to find factorial of any number. N=5
9. What are iteration statements? Name the two iteration statement provided by the PYTHON.
Repeated execution of a set of statements in a program is called iteration.
Python provides two types of looping constructs:
while statement
for statement