Page 123 - Computer Genius Class 08
P. 123

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 = 07
                           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 popular programming language that can be used for a wide variety of applications. 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 issue that arises unexpectedly in a computer, as a result the
                      computer could not function properly.
                    l  A variables 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.



                                                                                            Basics of Python  121
   118   119   120   121   122   123   124   125   126   127   128