Page 136 - 2620_Birla Open Mind C-8
P. 136

Program 9: To use various string built-in functions

                   Program3.py

                File  Edit  Format   Run   Options   Window    Help
                str = 'Hello'
                print(len(str))
                print('Hello'.lower())
                print('hello'.upper())
                print('hello'.capitalize())




                  Output

                5
                hello
                HELLO
                Hello







                       Double Tap                                                 Century   #Information Literacy
                                                                                     21 st
                                                                                    Skills
                     1.  What is a string?




                     2.  What are escape sequences?








                         Interdisciplinary Learning

                         #English

                 Create a program in Python to display a stanza of a poem from your English course book. Use various
                 string built-in functions to capitalise the first letter of each line of the poem.


                                                                                                         #Lab Activity



                   SOME MORE PROGRAMS

              Program 10: To calculate the area of different shapes




                  134  Premium Edition-VIII
   131   132   133   134   135   136   137   138   139   140   141