Page 346 - Artificial Intellegence_v2.0_Class_9
P. 346

7.  Explain the three different numeric data types available in Python.

            8.  Explain three different types of errors in Python.
            9.  Define all the three important programming constructs.

           10.  What is type conversion? Explain the types of type conversion with the help of an example.   [CBSE Handbook]
           11.  Differentiate between for loop and while loop.

           12.  List the important rules to remember when using range() function in for loop.

           13.  What is Iteration? Explain two different ways of using iteration in Python.
           14.  What are important features of lists in Python?
           15.  Name different ways of deleting an element in a list.

           16.  What is the use of * operator in a list.

           17.  Explain two different ways of indexing in a list.

        C.  Write Python code for the give instructions.
            1.  Input three angles and check whether they form a triangle or not.

            2.  Input the temperature in Fahrenheit and change into degrees.
            3.  Input time in seconds and change it into minutes.
            4. Find the result of 22/7 * 5 * 5 i.e. the area of circle having radius as 5         [CBSE Handbook]

            5.  Input length and breadth and display whether it is a square or not.
            6.  Input a number between 1 and 7 and display the weekday based on the number entered.
            7. Take a Boolean value “False” and a float number “15.6” and perform the AND operation on both.   [CBSE Handbook]

            8.  Input Salary and Years of Service. If the number of years are more than 5 then give an extra bonus of 15%. Display the
               net salary after adding the bonus.
            9. Take a string “Zero” and a Boolean value “True” and try adding both by using the Bool () function.   [CBSE Handbook]
           10.  Input a billing amount of shopping done. If the amount is more than 5000 then give a discount of 10%. Display the net
               billing amount after the discount.
           11.  Input a year and check whether it is a leap year or not.

           12. Take a Boolean value and add a string to it.                                       [CBSE Handbook]

           13. Take a string “Morning “and the float value “90.4” and try and add both of them by using the float () function.
                                                                                                  [CBSE Handbook]




                          Lab                                                                     Computational Thinking



                  1.   Write an algorithm for calculating Net salary of a person (Net Salary=Basic + Allowances – Deductions).
                     Take the Basic, Allowances and Deductions as input.
                  2.   Write an algorithm to print larger of the two marks taken as an input. Also draw a flowchart.
                  3  Write a Python program to:
                     a.  Convert Celsius to Fahrenheit using the formula: (Celsius * 1.8) + 32



              344     Touchpad Artificial Intelligence (Ver. 2.0)-IX
   341   342   343   344   345   346   347   348   349   350   351