Page 94 - 2619_PlusGPT V2.1_C-8
P. 94

d.    The if statement executes a command if the provided condition evaluates
                        to true.                                                                          ____________

                  4.  Answer the following:
                     a.  What is decision making statement?
                          _____________________________________________________________________________________

                          _____________________________________________________________________________________

                     b.  Write the syntax of the if statement.
                          _____________________________________________________________________________________

                          _____________________________________________________________________________________

                     c.  Draw the flowchart for if...else statement.
                          _____________________________________________________________________________________
                          _____________________________________________________________________________________

                          _____________________________________________________________________________________
                          _____________________________________________________________________________________

                     d.  Write a Python program to convert centimeters to inches. (Hint: 1 inch = 2.54 cms)
                          _____________________________________________________________________________________

                          _____________________________________________________________________________________
                          _____________________________________________________________________________________

                          _____________________________________________________________________________________




                fun Zone




                    Let's soLve
                                                                                                    Computational Thinking
                       What will be the output of the following programs?

                      1.  a = int ( input ( "Enter a First Number: " ) )
                        b = int ( input ( "Enter a Second Number: " ) )
                        if a > b :
                                print ( "First number is greater than second number " )
                        else :
                                print ( "Second number is greater than first number " )
                      2.  num = 44
                        if num % 2 == 0:
                            print(num, "is Even")
                        else:
                            print(num, "is Odd")




                  92    Premium Edition-VIII
   89   90   91   92   93   94   95   96   97   98   99