Page 147 - 2622_Delhi Police Public School_C-7
P. 147

b.  y = 8

                              if (y > 5):

                                  print("y is greater than 5")












                           c.  x = 10

                              if (x = 5):

                                  print("x is equal to 5")








                       3.  Competency-based/Application-based questions:

                           a.   Ajit wants to develop a Python program that check the strength of the password entered by the
                              user based on the following criteria:
                                  Weak: Less than 4 characters
                                  Moderate: 4-8 characters
                                  Strong: More than 8 characters
                              Which conditional statement should he use?

                           b.   Seema is the owner of a gym. She wants a Python program that calculates the fee on the basis of
                              the age of the member. Help her by writing the required code. Use the following criteria:
                                  Under 18: 500 per month
                                  Above 18 or equal: 700 per month
                           c.   Maria needs to categorise students into different grade levels based on their ages (e.g., elementary
                              school, middle school, high school). What type of statement should she use to check the age range
                              and assign the appropriate grade level?
                           d.   Hiral wants to develop a program in Python that checks whether the first letter of the student’s
                              name is a vowel or consonant. Help her by writing the condition used for this purpose.


                           SDG Activity



                    Conduct a survey to identify male-to-female ratios among teaching staff, students, and
                    housekeeping staff at your school. Use Python to analyse the data and display the result.
                    Then, suggest three different ways to promote gender equality in your school based on
                    your findings.







                                                                                Conditional  Statements in Python  145
   142   143   144   145   146   147   148   149   150   151   152