Phone

+919997782184

Email

support@roboticswithpython.com

Geeks of Coding

Join us on Telegram

Viewing 0 reply threads
  • Author
    Posts
    • #911
      Abhishek TyagiAbhishek Tyagi
      Keymaster

      1. Which came first, the instance of the class?

      Answer-
      class

      2. In Object-Oriented Programming, what is another name for the “attributes” of an object?

      Answer-
      fields

      3. At the moment of creation of a new object, Python looks at the _________ definition to define the structure and capabilities of the newly created object.

      Answer-
      class

      4. Which of the following is NOT a good synonym for “class” in Python?

      Answer-
      direction

      5. What does this Python statement do if PartyAnimal is a class?

      zap = PartyAnimal()
      Answer-
      Use the PartyAnimal template to make a new object and assign it to zap

      6. What is the syntax to look up the full name attribute in an object stored in the variable colleen?

      Answer-
      colleen.fullname

      7. Which of these statements is used to indicate that class A will inherit all the features of class B?

      Answer-
      class A(B) :

      8. What keyword is used to indicate the start of a method in a Python class?

      Answer-
      def

      9. What is “self” typically used for in a Python method within a class?

      Answer-
      To refer to the instance in which the method is being called

      10. What does the Python dir() function show when we pass an object into it as a parameter?

      Answer-
      It shows the methods and attributes of the object

      11. Which of the following is rarely used in Object-Oriented Programming?

      Answer-
      Destructor

Viewing 0 reply threads
  • You must be logged in to reply to this topic.