Page 128 - Trackpad_V5_Book 8
P. 128

You will get the following output:














            STRING BUILT-IN FUNCTIONS

            Python includes the following built-in functions to manipulate strings:
               len(): The len() function calculates and returns the length of a string supplied as an argument.
              Syntax of using len() function is:

              len(string_name)
               lower(): The lower() function converts all uppercase letters to lowercase. Syntax of using lower()

              function is:

              string_name.lower()
               upper(): The upper() function  converts all  lowercase  letters  to  uppercase.  Syntax  of using
              upper() function is:

              string_name.upper()
               capitalize(): The capitalize() function returns a string with the first character in capital. Syntax
              of using capitalize() function is:

              string_name.capitalize()

            Program 10: To use various string built-in functions.













            You will get the following output:






















            126   Pro (Ver. 5.0)-VIII
   123   124   125   126   127   128   129   130   131   132   133