Page 155 - TrackpadV2.1_Class8
P. 155

21 st
                 5.  Application-based questions.                                            Century   #Critical Thinking
                                                                                               Skills
                    a.   Simran is creating a Python program for her school maths project. She wants to create a relation
                      chart between various data types. What type of operators should she use?
                    b.   Anaya works as a programmer in an organisation where she has written the Python code.
                      In that code, she skipped the closing parenthesis with the print function. Which type of error
                      occurred in her code?




                      LAB ACTIVITY                                                             21 st   #Critical Thinking
                                                                                             Century
                                                                                               Skills  #Technology literacy
                       Visit your computer lab and perform the following actions:
                            Write a program to enter two numbers and print their difference.
                            Write a program to calculate the area of a triangle.
                            Write a program to calculate average of 6 numbers.
                           Write a program to convert Kilometres into Metres and Centimetres.




                          COding Zone      COding Zone     {}      =     COding Zone #Critical Thinking
                                {C ding z ne}
                                                                                              21 st
                                                                                                             []
                                                                                           Century
                                                                                             Skills
                                                                         </>
                                                                                                    COding Zone
                     What will be the output of the following programs?
                     a.  a = 4.5                          d.  a = 4
                       b = 2                                b = 11
                       print (a//b)                         print(a or b)
                                                            print(a > 2)
                     b.  y = 10
                       y += 2                             e.  a = 7
                       print(y)                             b = 8
                                                             print((50 - 6 // a) > 9 or 9 ** b > 11)
                     c.  p, q, r = 10, 20 ,30
                       print(p, q, r)                     f.  a = 10
                                                            b = 4
                                                            print((a == 6) + b)








                       CAREER HERE
                 People who are expert in Python may pursue their career as a Software Developer.




                    FOR THE TEACHER
                   1.  Explain various types of data types in detail.
                   2.  Give small programs related to interesting, real-life examples to the students.




                                                                                    Tokens and Data Types in Python  153
   150   151   152   153   154   155   156   157   158   159   160