Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 119 - 2611_SmartGPT Pro V(5.0) C-6
P. 119

    1.  Tick ( ) the correct option.

                        a.  Which function is used to take input from the user in Python?

                            (i)  get()                                    (ii)  input()
                           (iii)  read()                                  (iv)  scan()

                        b.  Which symbol is used to write single-line comments in Python?

                            (i)  //                                       (ii)  /*
                           (iii)  #                                       (iv)  "

                        c.  Which of the following data types is used to store a number with a decimal point?

                            (i)  int                                      (ii)  float
                           (iii)  str                                     (iv)  bool
                        d.  What does the print() function do in Python?

                            (i)  Takes user input                         (ii)  Displays output on the screen

                           (iii)  Terminates a program                    (iv)  Saves a file
                        e.  In order to save and reuse programs, where should the code be written?

                            (i)  Python Shell                             (ii)  Python Editor’s window
                           (iii)  Command Prompt                          (iv)  None of these

                     2.  Fill in the blanks using the words from the help box.

                                               Interpreted, Quotes, Operands, High-level

                        a.  Python is a __________ object-oriented programming language.
                        b.  To write a multi-line comment in Python, we use the triple __________.

                        c.  Python is also an __________ language that executes code line by line.
                        d.  The values that the operators use to get the output are called __________.

                     3.  Answer in one or two words.

                        a.  Who is the creator of Python?                                                   ___________
                        b.  What type of language is Python in terms of memory allocation?                  ___________
                        c.  What is the file extension for Python files?                                    ___________

                        d.  What is the name of the interactive Python code writing environment?            ___________

                     4.  Think and answer.
                        a.  Describe the use of the input() function in Python.

                         _______________________________________________________________________________
                         _______________________________________________________________________________

                                                                                                 Introduction to Python  117

| 114 115 116 117 118 119 120 121 122 123 124 |