Page 109 - KEC Khaitan C8.5 Flipbook
P. 109

On running the above program, we get the following output:

                     Output

                  Enter your age: 25
                  The price of the ticket is Rs. 350.







                      REVISIT


                       A control structure is a programming language construct which affects the flow of the execution of a
                     program.
                       The statements that are executed in sequential order, i.e. one after the other without any jumps, are called
                     sequential statements.
                       When programmers are required to execute a particular set of statements depending upon a particular test
                     condition, a branching statement is required.
                       Logical operator return a Boolean result (True or False) based on the logical relationship between the
                     conditions.
                       String is a sequence of characters which is enclosed or surrounded by single (' '), double (" "), or Triple (''' ''')
                     quotes.




















































                                                                                        Control Structures in Python  107
   104   105   106   107   108   109   110   111   112   113   114