Page 65 - Modular v1.1 Pyhton
P. 65

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















                     STRING OPERATORS

                 Various operations that can be performed on a string are Concatenating, Replicating, Membership
                 (in /not in), Comparison and Slicing.

                 String Concatenation Operator (+)

                 String concatenation operator (+) joins two or more strings into one.

                 Program 6: To join two or more strings using string concatenation operator.










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












                   String Replication Operator (*)

                 The replication operator is used to repeat the string for a given number of times.

                 Program 7: To repeat a string using string replication operator.







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














                                                                                      String Handling in Python   63
   60   61   62   63   64   65   66   67   68   69   70