Page 99 - ThinkGPT_V2.1_C7_Flipbook
P. 99

Program: To display one of the two alternate messages.
















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




















                 Program: To check if the given number is lucky or not, if the given number is greater than zero
                 and is even, then print ‘Lucky number’ else print ‘Not a lucky number’.

















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
























                                                                                            More on Python    97
   94   95   96   97   98   99   100   101   102   103   104