Page 98 - KEC Khaitan C7 Flipbook
P. 98

elif (conditional expression):
                              statement(s)
                      else:

                              statement(s)


                                                    Start



                                                                 True
                                                 if condition 1         Statement 1


                                                        False

                                                                 True
                                                 if condition 2         Statement 2


                                                       False

                                                                 True
                                                 if condition 3         Statement 3

                                                       False
                                                                         Statement



                                                                                      Stop


                  Program 4: To grade a student according to his/her marks

                      Program4.py
                   File  Edit  Format    Run   Options   Window    Help

                   #Program to grade a student according to his/her marks
                   marks = int(input('Enter marks: '))
                   if(marks >=90):
                       print('Grade A+')
                   elif(marks >=80):
                       print('Grade A')
                   elif(marks >=70):
                       print('Grade B+')
                   elif(marks >=60):
                       print('Grade B')
                   elif(marks >=50):
                       print('You can do better!!!')
                   else:
                       print('You need to work hard!!!')






                   96   Premium Edition-VII
   93   94   95   96   97   98   99   100   101   102   103