Describe the difference between objects and values using the terms “equivalent” and “identical”. Illustrate the difference using your own examples with Python lists and the “is” operator.
Describe the relationship between objects, references, and aliasing. Again, create your own examples with Python lists.
Finally, create your own example of a function that modifies a list passed in as an argument. Describe what your function does in terms of arguments, parameters, objects, and references.
Create your own unique examples for this assignment. Do not copy them from the textbook or any other source.
the variable is created in a python by means of the sign "=" where on the left part there will be a name of a variable and on right values of a variable. The variable and an object in a python are praktichesik equivalent concepts. But there are distinctions as a python there are two types of objects:
1) unchangeable such as numerical data, lines, trains. For example at a
equate variables values an object the having
some identifier is created:
>>> a=2
>>> id(a)
1407502272
When giving the same variable of new value the identifier changes, that is is created new an object:
>>> a=2
>>> id(a)
1407502272
>>> a=5
>>> id(a)
1407502320
>>>
Comments
Leave a comment