Page 87 - Modular v1.1 Pyhton
P. 87

On running the above program, you will get the following output:
























                     OPERATIONS ON A TUPLE

                 Most common operation which you can perform with tuple is described in the table given below.

                      Operators             Operation                             Explanation

                           +           Joining tuples          ‘+’ operator is used to join two tuples

                            :          Slicing the tuples      Extracting the sub parts of the tuple

                            *          Tuple multiplication    Repeats the tuple by the given number of times


                  Clickipedia


                   You can join two or more tuples to form a new tuple. While using ‘+’ operator, both the operand
                   must be of same tuple type i.e. you cannot add a number or any other value to a tuple.



                 Program 8: Operations on a tuple.











                 On running the above program, you will get the following output:

















                                                                                               Tuple in Python    85
   82   83   84   85   86   87   88   89   90   91   92