Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 129 - 2609_Logiccode
P. 129

    Start

                     Syntax:                                                 if condition 1  False      block 3

                     if (condition 1):
                                                                                   True
                          if (condition 2):
                               Indented block 1
                                                                                            False
                          else:                                              if condition 2             block 2
                               Indented block 2
                     else:                                                         True
                          Indented block 3
                                                                               block 1

                                                                                Stop

                     Program:  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.

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

                                                                                                      More on Python  127

| 124 125 126 127 128 129 130 131 132 133 134 |