Page 70 - KEC Khaitan C7 Flipbook
P. 70

Imagine, comments in Python are secret messages from a wise mentor. What advice
                                    or tips would you leave in your code for future programmers to discover?






                         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.  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



                   68   Premium Edition-VII
   65   66   67   68   69   70   71   72   73   74   75