Page 116 - Touchpad_Plus_V3.2_Class 7
P. 116

Indented block 2

                  else:
                       Indented block 3


                                                   Start



                                                                False
                                                if condition 1             block 3



                                                       True

                                                                False
                                                if condition 2              block 2



                                                       True
                                                   block 1




                                                   Stop


                  Program 5: To find out if the student is selected for the college or not based on the given
                  conditions–

                  1.  Selected if age > 18 and marks > 65
                  2.  Not selected if age > 18 and marks < 65

                  3.  Not selected if age < 18
                                                              Program5.py

                    File  Edit  Format   Run   Options   Window    Help

                    #Program to check if a student is selected for college or not
                    name = input('Enter the name of the student: ')
                    age = int(input('Enter the age of the student: '))
                    marks = int(input('Enter the marks of the student: '))
                    if(age > 18):
                        if(marks > 65):
                            print(name, 'is selected for college')
                        else:
                            print(name, 'is not selected for college')
                    else:
                        print(name, 'is too young for college')








               114      Plus (Ver. 3.2)-VII
   111   112   113   114   115   116   117   118   119   120   121