Anda di halaman 1dari 1

 E-mail Us:  Call Us: Stay Connected:   

Blog
HOME
POOJA UNCATEGORIZED CLASS 11 IP CHAPTER 5 CONDITIONAL AND ITERATIVE STATEMENTS –
 
BHATIA CLASSES TUITIONS WE PROVIDE  JOBS/INTERNSHIP CONTACT US
SOLUTIONS – SUMITA ARORA NEW SYLLABUS

Class 11 IP Chapter 5 Hari Nagar

Conditional And Iterative Phone: 98188 072 71


Email:

Statements – Solutions – poojabhatiaclasses@gm


ail.com
Sumita Arora New
Syllabus

Ex 5.1

1. What is a statement ? How many types of statements are


there in Python ?

...

click here for answers

5. What is the need for selection and looping constructs ?

3. What is a compound statement ? Give example of a


compound statement.

4. What are the three constructs that govern statement


ow ?

2. What is the signi cance of a pass statement?

Ex 5.2

6. What will be the output of the following code fragment if


the input given is (i) 2000 (ii) 1900 (iii) 1991 ?

...

click here for answer

5. What will be the output of the following code fragment if


the input given is (i) 2000 (ii) 1900 (iii) 1971 ?

4. What will be the output of following code fragment if the


input given is ( i ) 7 ( ii) 5 ?

3. Correct the following code fragment :

2. How does a conditional expression a ect the result of if


statement?

1. What is a selection statement? Which selection


statements does Python provide ?

Ex 5.3

16. Can a single break statement in an inner loop terminate


all the nested loops ?

15. What is the signi cance of break and continue


statements?

14. What is the output produced by following loop ?

13. What will be the output of following code:

12. If the test-expression of a while loop evaluates to false


in the beginning of the loop, even before entering in to the
loop : (a) how many times is the loop executed? (b) how
many times is the loop-else clause executed ?

11. Why is while loop called an entry controlled loop ?

10. What is the similarity and di erence between for and


while loop ?

8. Write a for loop that displays the even numbers from 51


to 60.

9. Suggest a situation where an empty loop is useful.

7. What is the output of following code ?

6. Why does “Hello” not print even once ?

5. What is the output of the following code fragment ?

3. What is the use of range() function ? What would


range(3, 13) return ?

4. What is the output of the following code fragment ?

2. What are the two categories of Python for a in range(3) :


for b in range(5,7) : Loops ?

1. What are iteration statements ? Name the iteration


statements provided by Python.

Back Exercise Part A

17. What are jump statements ? Name them.

...

click here for answers

16. In which cases, the else clause of a loop does not get
executed.

15. What is the di erence between else clause of if-else


and else clause of python loops ?

14. What are the four elements of a while loop in python ?

13. What is entry-controlled loop ?

12. Write pseudocode for comparing two products of two


sets of numbers (a, b and c, d) and displaying if both
products are same or not.

11. Draw decision tree for grade calculation as per :

10. Draw owchart for displaying rst 10 odd numbers.

9. Write pseudocode for checking if a number is a factor of


3215 ?

8. What is decision tree ? Where are these useful ?

7. What is pseudocode ? How is it useful in developing logic


for the solution of a problem ?

6. What is a owchart ? How is it useful ?

19. What are endless loops ? Why do such loops occur ?

5. What is an algorithm ?

18. How and when are named conditions useful ?

4. Which Python statement can be termed as empty


statement ?

3. What is empty statement ? What is its need ?

1. What is the common structure of Python compound


statements ?

2. What is the importance of the three programming


constructs ?

8. When do you think text les should be preferred over


binary les ?

Back Exercise Part B

11. Draw decision tree for grade calculation as per :

Decision Tree ...

click here for answers

6. What is a owchart ? How is it useful ?

8. How are following two code fragments di erent from


one another ? Also, predict the output of the following
code fragments :

9. Rewrite the following code fragments using for loop :

10. Rewrite following code fragments using while loops :

11. Predict the output of the following code fragments :

12. What is the output of the following code ?

13. In the nested for loop code above (Q. 12), how many
times is the condition of the if clause evaluated?

14. Which of the following Python programs implement the


control ow graph shown ?

4. Which Python statement can be termed as empty


statement ?

7. What is following code doing ? What would it print for


input as 3 ?

5. What is the output of the following lines of code ?

6. Find the errors in the code given below and correct the
code :

3. What is the output produced by the following code ?

1. Rewrite the following code fragment that saves on the


number of comparisons:

4. What is the error in following code ? Correct the code :

2. Under what conditions will this code fragment print


“water” ?

Back Exercise Part C

1. Write a Python script that asks the user to enter a length


in centimetres. If the user enters a negative length, the
program should tell the user that the entry is invalid.
Otherwise, the program should convert the length to
inches and print out the result. There are 2.54 centimetres
in an inch.

# Code ...

click here for answer

2. A store charges ? 120 per item if you bu^ less than 10


items. If you buy between 10 and 99 items, the cost is ?
100 per item. If you buy 100 or more items, the cost is ^ 70
per item. Write a program that asks the user how many
items they are buying and prints the total cost.

3. Write a program that asks the user for two numbers and
prints Close if the numbers are within .001 of each other
and Not close otherwise.

4. A year is a leap year if it is divisible by 4, except that


years divisible by 100 are not leap years unless they are
also divisible by 400. Write a program that asks the user for
a year and prints out whether it is i leap year or not.

5. Write a program to input length of three sides of a


triangle. Then check if these sides will form a triangle or
not. (Rule is : a + b >,c ; b + c > a ; c + a > b )

6. Write a short program to input a digit and print it in


words.

7. Write a short program to print rst n odd numbers in


descending order.

8. Write a short program to print the following series :

9. Write a short program to nd average of list of numbers


entered through keyboard.

10. Write a program to take an integer a as an input and


check whether it ends with 4 or 8. If it ends with 4 print
“ends with 4”, if it ends with 8, print “ends with 8”,
otherwise print “ends with neither”.

11. Write a program to take N (N > 20) as an input from the


user. Print numbers from 11 to N. When the number is a
multiple of 3, print “Tipsy”, when it is a multiple of 7, print
“Topsy”. When it is a multiple of both, print “TipsyTopsy”.

12. Write a short program to nd largest number of a list of


numbers entered through keyboard.

13. Write a program to input N numbers and then print the


second largest number.

14. Given a list of integers, write a program to nd those


which are palindromes. For example, the number 4321234
is a palindrome as it reads the same from left to right and
from right to left.

15. Write a Python program to print every integer between


1 and n divisible by m. Also report whether the number that
is divisible by m is even or odd.

16. Write a program to accept the age of n employees and


count the number of persons in the following age- group :
(i) 26 – 35 (ii) 36 – 45 (iii) 46 – 55.

17. Write a program using nested loops to produce a


rectangle of *’s with 6 rows and 20 *’s per row.

18. Given three numbers A, B and C, write a program to


write their values in an ascending order. For example, if A =
1,2, B = 10, and C =15, your program should print out :
Smallest number = 10 Next higher number = 12 Highest
number = 15

19. Ask the user to enter a temperature in Celsius. The


program should print a message based on the temperature
:

20. Write a program to calculate correlation coe cient


after collecting data about 10 of your classmates are in the
form of

21. Write a program to calculate standard deviation for a


batsman’s score in last 10 matches.

Online Flowchart Maker


Get the most powerful, professional owchart
software on the market. Free 7-day trial.

PREVIOUS POST NEXT POST

 Class 11 IP Chapter 4 Class 11 IP Chapter 14 


Data Handling - Simple Queries in SQL -
Solutions Sumita Arora - Solutions - Sumita Arora
New Syllabus New Syllabus

 Hari Nagar, New Delhi -110064

 Phone: 98188 072 71

 Email: poojabhatiaclasses@gmail.com

Best Coaching Institute in


Hari Nagar

We Help  students from class 1 to 12 Score Excellent


Marks

Pooja Bhatia Classes © All Rights Reserved   

Anda mungkin juga menyukai