Page 128 - Code_GPT_Class_8
P. 128

5.   What is the difference between the string concatenation operator and the string replication operator?
                         Explain with an example.










                     Scratch Your Brain.                                                        21 st  Century   #Critical Thinking
                                                                                                    Skills
                                 1.  Write the output of the following programs:

                         a.   print("Hello")

                            print("i love"+ "python\n\n
                            and enjoy doing it.")

                          b.  fruit='mango'

                            fruit1=fruit.upper()

                            print(fruit1*3)

                          c.  car='ferrari'

                            print(car.upper())

                            print(car.lower())

                            print(len(car))

                            print(car.capitalize())
                          d.  def total(a,b):


                                  sum=a+b

                                  print(sum)

                            total(14,16)
                          e.  def Name(fname,lname):


                                  full_name=fname+" "+lname
                                  return full_name

                            your_name=Name("Sonia",'Mittal')

                            print(your_name)

                      2.  Find errors in the codes given below and correct them.

                         a.  print('I am Akshay Kumar')







                        CodeGPT (Ver. 4.0)-VIII
                126
   123   124   125   126   127   128   129   130   131   132   133