Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 147 - 2612 Digimind C6
P. 147

    Hashtag

                          #Python: Object-oriented high-level programming language
                          #IDLE: Stands for Integrated Development and Learning Environment

                          REVISIT

                       ▶   Interactive Mode and Script Mode are the two working mode in Python.
                       ▶   The input() function takes the user’s input while a program executes.
                       ▶   The print() function is used to display the content on the screen.
                       ▶   Variables are memory reference points where we store values which can be accessed or changed later.

                       ▶   A data type specifies the type of value a variable can contain.
                       ▶   Comments enable us to understand the way a program works.
                       ▶   Operators are special symbols which perform computation.

                     1.  Tick ( ) the correct option.

                        a.   Riya is creating a Python program that asks the user to enter their name and age while the program
                           is running. Which function should she use to take input from the user?

                            (i)  get()                                     (ii)  input()

                           (iii)  read()                                   (iv)  scan()

                        b.   While writing a Python program, Amit wants to add a note explaining a line of code so that others
                           can understand it, but he does not want the note to be executed. Which symbol should he use to
                           write a single-line comment?

                            (i)  //                                        (ii)  /*

                           (iii)  #                                        (iv)  "

                        c.   Neha is writing a Python program to store a student’s height as 5.6 feet. Which data type should she
                           use to store this value?
                            (i)  float                                     (ii)  int

                           (iii)  str                                      (iv)  bool

                                                                                                 Introduction to Python  145

| 142 143 144 145 146 147 148 149 150 151 152 |