Basic HTML Version

|  | Table of Contents |  | View Full Version

Page 143 - 2607_Trackpad_Pro_5.1_flipbook_C7
P. 143

    6.  Do as directed.                                                                            4×2.5=10
                      a. Write an HTML code that generates the given output:

                      b. Create a Python program that asks the user to enter their age. The program should print:
                            • Child, if the age is less than 12

                            • Teenager, if the age is between 12 and 17
                            • Adult, if the age is 18 or above

                      c. A store offers discounts based on the total bill amount. Write a Python program that calculates
                         a discount of 10% if the bill is above Rs. 2000 and an additional 5% if it is above Rs. 5000.

                      d. A student wants to check whether a given character is a vowel or a consonant. Write a Python
                         program to check if the given character is a vowel (a, e, i, o, u) or not using an if-elif-else
                         statement.

                      142   Premium Edition-VII

| 138 139 140 141 142 143 144 145 |