Page 429 - Ai_417_V3.0_C9_Flipbook
P. 429

E.  Rewrite the following logic:
                    1.  Using while loop                             2.  Using for loop
                       for C in range(1,5,2):                            sum=0
                           print (C)                                     i=20
                       print("Python")                                   while i>10:
                                                                             sum+=i
                                                                                 i-=2
                                                                         print(sum)
                 F.  Find the output of the given code:

                    1.   A=10                                        2.  I = 10; J = 50
                       for i in range(2, A, 2):                          if (I > 10 and J < 100):
                           print(A,i,sep='2',end='*')                        print(I, J)
                                                                         else:
                                                                             print(J)
                    3.  for i in range(5):

                           if i%2==0:
                              print(i, end="*")

                                                  SECTION B (Subjective Type Questions)

                 A.  Short answer type questions:
                    1.  Name the two coding programs available in CodeCombat.
                    2.  Why are flowcharts more preferred than algorithms?
                    3.  Can we write more than one algorithm for the same problem? Explain.
                    4.  What is the meaning of selection flow in control structures?
                    5.  How can we create a multi-line string in Python?
                    6.  What is the use of the print( ) function? Give a few examples to support your answer.
                    7.  What are variables? Why are they important in any programming language?
                    8.  How is floor division different from normal division?
                    9.  What is the meaning of sequential programming?

                    10.  What is nested if statement?
                    11.  Why is it necessary to give step value in while loop?
                    12.  Why while loop called an entry-controlled loop?
                    13.  What is the use of sort( ) function of a list?
                    14.  What are the key features of Python? Mention various applications along with it.   [CBSE Handbook]
                    15.  What is the difference between pop( ) and remove( ) functions?
                    16.  What will be the output of the following statement?

                       print([1, 2, 6] < [1, 2, 5])
                 B.  Long answer type questions:
                    1.  Give three differences between an algorithm and a flowchart.

                    2.  Explain three symbols used in flowcharts.
                    3.  Explain the steps involved in computer problem-solving.
                    4.  Explain with an example the three control structures.
                    5.  Explain mathematical operators with examples.

                                                                                        Introduction to Python  427
   424   425   426   427   428   429   430   431   432   433   434