-
A Python list is a mutable ordered collection of values. A Python tuple is an immutable ordered collection of values. A list could be
[1, "a", object(), 5]
. A tuple could be(1, "a", object(), 5)
. -
A namespace in Python is a syntactic construction, which has a unique identity, a name, and a set of values which are declared and logically stored inside it. Often (and when not private), they can be accessed from outside of the namespace using dot syntax. Modules, files, class declarations, and function definitions all create namespaces.
-
A global variable is accessible at the file scope, and therefore in all enclosed scopes that inherit outer scopes' globals. If it is not private, a module-global variable is also accessible and mutable by other modules. The scope of a local variable is limited to the class declaration, function definition,
with
statement, or scoping control block such asif
orfor
in which it was first declared. -
An IDE or Integrated Development Environment is a design, engineering and debugging tool allowing a programmer to write syntax highlighted code with help from completion and introspection tools, check the program statically for errors before it is run, debug the program while it is running, and manage project and program structure.
-
A Python module is a logical structure which associates together and organises related and interdependent code, so that it can be run, compiled, shipped, or imported as a package all at once. A module may be a single file, which can be imported directly, or it may be a folder structure with
__init__.py
,__main__.py
and so on. A class declaration can also create a module under the right circumstances. Examples of Python modules area_file
(whena_file.py
exists in the current directory),time
, andabc
. -
Python does not expose CPython arrays as a user language feature. An array is a strictly-typed homologous ordered collection of the same hardware data type. Python array implementations provided by libraries such as
numpy
abstract over Python'slist
syntax, and provide their own highly-optimised functions for working with sets of data that are known to be of a single type, such asint
. A Python list is an abstraction and a language feature which represents a mutable ordered collection of Python values. As a result of their dynamic typing, Python lists do not represent hardware types directly, and instead contain pointers to CPython objects. -
A Python operator is a syntactic structure consisting of one or more characters, which has a logical meaning about how to handle those values. Values that appear adjacent in Python syntax must always be separated by an operator. Examples of operators are
,
(the comma operator for separating values),+
(the__add__
operator), andis
(the identity comparison boolean operator).
Created
January 12, 2023 14:40
-
-
Save catb0t/07c767d0fc100f7599ade4e678542dba to your computer and use it in GitHub Desktop.
python questions
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment