Page 122 - ComputerGenius_V2.1_Class8
P. 122

Computational Thinking
                         Quest


                       Write the output of the following:

                        1.   A, B, C = 20,12/4,16+5                      2.  x='Stem'
                                                                             y ='Robo'
                            print (A, B, C)
                                                                             print (x+y)



                        3.  x=15.4                                       4.   x = -10
                            y =3.2                                           y = 10
                            print (x-y)                                      print (x>y)
                            print (x*2)                                      print (x<y)
                            print (x/y)                                      print (x==y)







                        5.   x = 'apple'                                 6.   x = 12
                            y = 'orange'
                                                                             y = 7
                            print (x>y)
                                                                             z = 10
                            print (x<y)
                                                                             print (x>y and z>x)
                            print (x==y)
                                                                             print (x>y or z>x)
                            #hint alphabetical order
                                                                             print (not x>y)










                        Let's REFRESH


                     l   Python is a high-level, easy-to-read programming language used for various applications like web
                       development and data analysis. It was created by Guido van Rossum, and released in 1991.
                     l   Python can be used to create web applications, AI development, solving complex mathematics or for
                       Rapid Prototyping.
                     l   An error is a term used to describe any concern that arises unexpectedly in a computer, as a result
                       the computer could not function properly.
                     l   A variable can be considered as a container that holds data whose value can be changed later through
                       programming.
                     l   Single-line  comments  are  created  simply  by  starting  with  the  hash  ‘#’  character,  and  they  are
                       automatically terminated as the line ends.

                     l   Operators are special symbols in Python that can carry out different types of computations.


                      120    Computer Genius (V2.1)-VIII
   117   118   119   120   121   122   123   124   125   126   127