Page 78 - Digicode_AI_class_8
P. 78

3.  Define the term functions in programming.




                4.  Explain how arrays are indexed in programming.






                5.  How do you search a particular value from an array in Python?






                6.  Write any two advantages of array.







                                                                                 Critical Thinking
                                                                                 Information Literacy

              A.  Find the error in the following code and rewrite the code:
                  1.  if(age > 18)
                          print(‘You are eligible to vote’)
                     else:

                          print(‘Not eligible to vote’)
                  2.  num = int(input("Enter a Number: "))

                     if num > 10
                          print("Number greater than ten"):

                     elif num < 10:
                          print("Number less than ten")

                     else:
                          print("")

                  3.  arr=(10, 20, 30, 40, 50, 60):
                     print(index.arr("60"))

                  4.  Input first number (Num2)
                     Input second number (Num1)
                     Sum = Num3 + Num2
                     Print SUM









                 76    DigiCode AI-VIII
   73   74   75   76   77   78   79   80   81   82   83