Page 100 - ThinkGPT_V2.1_C8_Flipbook
P. 100

For example:


                                 def my_function( ):                                   Name of a function


                                       print (“Hello”)                                 Body of a function



                                 my_function( )                                        Function call


                  Program: To add two numbers using all the three types of user-defined functions.






























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




















                  Program: To print a string by calling a function.














                       98    Premium Edition-VIII
   95   96   97   98   99   100   101   102   103   104   105