Page 416 - Ai_417_V3.0_C9_Flipbook
P. 416

Exercise
                        At a Glance

                    • A program is written in any programming language which the computer can understand and execute.                                                                Solved Questions

                    • Control structures are a set of instructions that control the flow of instructions in a program.
                    • An algorithm is a step-by-step approach to identify and solve a problem in a finite time.                                                               SECTION A (Objective Type Questions)
                    • A flowchart is a graphical representation of an algorithm.                                                                      uiz
                    • CodeCombat is a free coding educational game that teaches you to learn JavaScript or Python coding in a fun way.      A.  Tick ( ) the correct option.
                    • Python is a general-purpose, object oriented, easy to learn and high-level programming language.                          1.  Which of the following symbols is used in flowcharts to take input from the user?

                    • Instructions written in a source code that are executed by a Python interpreter are called statements.                      a.  Diamond                                        b.  Rectangle
                    • Keywords in Python are predefined and reserved words with special meanings and purposes.                                    c.  Oval                                           d.  Parallelogram
                    • Tokens are the smallest meaningful unit of a program.
                                                                                                                                                2.  Coding and implementation is the ………………………. step in problem-solving.
                    • Identifiers are the user defined names of variables, list, dictionary, tuples, classes, etc.
                                                                                                                                                  a.  First                                          b.  Last
                    • Variable is a name given to a memory location to hold a specific value.
                                                                                                                                                  c.  Third                                          d.  Second
                    • Data types specify the kind of a value a variable can store. It helps us to identify the kind of operation that can be
                    performed on that specific data type.                                                                                       3.  Which of the following symbols is used to display the decision-making statements in a flowchart?
                    • Operators are special symbols used to perform mathematical, logical and relational operations on variables and values.      a.  Rectangle                                      b.  Line
                    • Comments are used to increase the readability of the code.                                                                  c.  Diamond                                        d.  Oval
                    • The print() function is used to print an output on the screen.                                                            4.  Which of the following is the step-by-step approach in simple English-like statements?

                    • The order of execution of these instructions controls the flow of a program.                                                a.  Algorithm                                      b.  Selection
                    • A step-by-step process of execution of code is called sequential flow of control.                                           c.  Flowchart                                      d.  Sequence
                    • Selection flow of control is achieved through conditional statements.
                                                                                                                                                5.  Which of the following is/are powerful tools for learning programming?
                    • The process of repeating a set of instructions based on a condition is called loop.
                                                                                                                                                  a.  Flowchart                                      b.  Algorithm
                    • The range( ) function is an inbuilt function that is used to generate a sequence of values between the specified range.
                                                                                                                                                  c.  Both a and b                                   d.  None of these
                    • List is a collection of heterogeneous data arranged in a sequence.
                                                                                                                                                6.  Which of the following is the valid name for (an) identifier(s) in Python?
                    • The elements of a list can be accessed by using its index number starts with 0 (zero).
                                                                                                                                                  a.  Test#4                                         b.  Rollno
                    • The + operator is used to concatenate the list with another list.
                                                                                                                                                  c.  9thClass                                       d.  else
                    • The * operator is used to replicate a list specific number of times.
                    • The comparison of the lists is done using comparison operators >, <, >=, <=, != and ==.                                   7.  Which of the following is a valid logical operator?
                    • The append( ) Function appends a single element with the given value(any datatype) at the end of the list.                  a.  and                                            b.  !=
                    • The extend() Function is used to append multiple values at a time in a list.                                                c.  +                                              d.  >=
                    • The insert( ) function is used to add a single value at a specific position in an existing list.                          8.  ZeroDivisionError error is a ………………………..

                    • The remove( ) function removes the first occurrence of the element with the specified value.                                a.  Syntax Error                                   b.  Logical Error
                    • The pop( ) function removes an element from the list based on the index number specified in the function and returns        c.  Runtime Error                                  d.  Not an Error
                    the deleted value.
                                                                                                                                                9.  Which of the following is a sequence of UNICODE characters?
                                                                                                                                                  a.  Boolean                                        b.  Numbers
                                                                                                                                                  c.  String                                         d.  Float

                                                                                                                                               10.  Which of the following is a data type that has two built-in values True or False?
                                                                                                                                                  a.  String                                         b.  Boolean
                                                                                                                                                  c.  Integer                                        d.  Float

                    414     Touchpad Artificial Intelligence (Ver. 3.0)-IX
   411   412   413   414   415   416   417   418   419   420   421