Consider the following Python 3.7.2 code [*] i ran in IDLE (I have added line numbers for reference):
[1] >>>> a_tuple = (1,2,3)
[2] >>>> a_tuple
[3] (1,2,3)
[4] >>>> print(a_tuple)
[5] (1,2,3)
[6] >>>> an_ndarray = numpy.array([1,2,3])
[7] >>>> an_ndarray
[8] array([1, 2, 3])
[9] >>>> print(an_ndarray)
[10] [1, 2, 3]
I am learning computer science terminology and Python, and I have the following questions/requests:
- What am I doing in [2], calling the object? Or is calling reserved for functions?
- What is being returned in [8]? It is not the contents of the
ndarray
. It doesn't make sense, but it is as if what is returned is the function call to create it, except it lacks thenumpy.
part. - Is
[1,2,3]
in [6] considered a list or just the syntax fornumpy.array()
arguments? - Is there a way to obtain the contents of an
ndarray
without thearray()
part in [8] and without usingprint()
? - Using precise technical terms, could you elaborate as to why [3] and [8] are so different?
- In general, what is what one types in the console called (e.g. [2])? Commands, calls, inputs?
- What are [3], [5], [8] and [10] called? Output? What are some synonyms?
- What is [*] (see the first sentence) called? It is not precisely code.