Python Forum
This is an open book home assignment but i really need your help - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: This is an open book home assignment but i really need your help (/thread-5372.html)



This is an open book home assignment but i really need your help - Samiha - Sep-30-2017

2.Consider the following statements.
*1 Class attributes are more suitable for sharing data across instances of a class as opposed to instance variables.
*2 Instance variables always point to a common location in memory regardless of which instance of a class is used to access them
*3 Abstraction cannot be utilized without Inheritance
*4 In order to enable access to instance variables, functions must have a “self” argument.
*5 Composition represents an “is-a” relationship between two entities.

Which combination of statements is true?

4, 3, 5, 1

1, 2, 3, 5

2, 3, 5, 4

5, 2, 4, 1

3. Which of the following scenarios depict true inheritance.
NB: -> represents the is a/an

*Vehicle -> Car -> Truck
*Pet -> Animal -> Dog
*Person -> Employee -> Manager
*User -> Admin -> Guest


5. The code class X(object): def __init__(self, J) can be interpreted as:
*Make a subclass X of class object that defines a constructor method that takes self and J as parameters
*Make a class X of object with a constructor method that has as parameters self and J
*Make a class X that inherits from an object class and has defined a constructor method that accepts as arguments the values of self and J
*All of the above


RE: This is an open book home assignment but i really need your help - Larz60+ - Sep-30-2017

We will not do your homework for you, but will be glad to answer questions
about the code that you write.


RE: This is an open book home assignment but i really need your help - buran - Sep-30-2017

actually you don't even need to write a code - that is a test and you need to study the learning material that you have and answer the questions.


RE: This is an open book home assignment but i really need your help - nilamo - Oct-04-2017

You didn't provide any info on what you need help on, so let's start at the top:

Quote: 2.Consider the following statements.
*1 Class attributes are more suitable for sharing data across instances of a class as opposed to instance variables.
What are your thoughts on this?