{"id":89,"date":"2019-01-15T23:25:03","date_gmt":"2019-01-15T23:25:03","guid":{"rendered":"https:\/\/courses.lumenlearning.com\/suny-albany-programmingforproblemsolving-v2\/back-matter\/glossary\/"},"modified":"2019-01-28T19:07:14","modified_gmt":"2019-01-28T19:07:14","slug":"glossary","status":"publish","type":"back-matter","link":"https:\/\/courses.lumenlearning.com\/suny-albany-programmingforproblemsolving-v2\/back-matter\/glossary\/","title":{"raw":"Glossary","rendered":"Glossary"},"content":{"raw":"\n<p><strong>argument<\/strong>\n<p>A value passed to a&nbsp;function&nbsp;(or&nbsp;method) when calling the function. There are two kinds of argument:<\/p>\n<ul>\n<li><em>keyword argument<\/em>: an argument preceded by an identifier (e.g.&nbsp;name=) in a function call or passed as a value in a dictionary preceded by&nbsp;**. For example,&nbsp;3&nbsp;and&nbsp;5&nbsp;are both keyword arguments in the following calls to&nbsp;complex():<\/li>\n<li>complex(real=3, imag=5)<\/li>\n<li>complex(**{'real': 3, 'imag': 5})<\/li>\n<li><em>positional argument<\/em>: an argument that is not a keyword argument. Positional arguments can appear at the beginning of an argument list and\/or be passed as elements of an&nbsp;iterable&nbsp;preceded by&nbsp;*. For example,&nbsp;3&nbsp;and&nbsp;5&nbsp;are both positional arguments in the following calls:<\/li>\n<li>complex(3, 5)<\/li>\n<li>complex(*(3, 5))<\/li>\n<\/ul>\n<p>Arguments are assigned to the named local variables in a function body. See the&nbsp;Calls&nbsp;section for the rules governing this assignment. Syntactically, any expression can be used to represent an argument; the evaluated value is assigned to the local variable.<\/p>\n<p><strong>assignment<\/strong>\n<p>A statement that assigns a value to a variable.<\/p>\n<p><strong>attribute<\/strong>\n<p>A value associated with an object which is referenced by name using dotted expressions. For example, if an object&nbsp;<em>o<\/em>&nbsp;has an attribute&nbsp;<em>a<\/em>&nbsp;it would be referenced as&nbsp;<em>o.a<\/em>.\n<p><strong>body<\/strong>\n<p>The sequence of statements within a compound statement.<\/p>\n<p><strong>boolean expression<\/strong>\n<p>An expression whose value is either True or False.<\/p>\n<p><strong>branch<\/strong>\n<p>One of the alternative sequences of statements in a conditional statement.<\/p>\n<p><strong>bug<\/strong>\n<p>An error in a program.<\/p>\n<p><strong>bytecode<\/strong>\n<p>Python source code is compiled into bytecode, the internal representation of a Python program in the CPython interpreter. The bytecode is also cached in&nbsp;.pyc&nbsp;files so that executing the same file is faster the second time (recompilation from source to bytecode can be avoided). This \u201cintermediate language\u201d is said to run on a&nbsp;virtual machine&nbsp;that executes the machine code corresponding to each bytecode. Do note that bytecodes are not expected to work between different Python virtual machines, nor to be stable between Python releases.<\/p>\n<p><strong>central processing unit<\/strong>\n<p>The heart of any computer. It is what runs the software<\/p>\n<p>that we write; also called \u201cCPU\u201d or \u201cthe processor\u201d.<\/p>\n<p><strong>chained conditional<\/strong>\n<p>A conditional statement with a series of alternative branches<\/p>\n<p><strong>class<\/strong>\n<p>A template for creating user-defined objects. Class definitions normally contain method definitions which operate on instances of the class.<\/p>\n<p><strong>class variable<\/strong>\n<p>A variable defined in a class and intended to be modified only at class level (i.e., not in an instance of the class).<\/p>\n<p><strong>comment<\/strong> Information in a program that is meant for other programmers (or anyone reading the source code) and has no effect on the execution of the program.<\/p>\n<p><strong>compile<\/strong>\n<p>To translate a program written in a high-level language into a low-level<\/p>\n<p>language all at once, in preparation for later execution.<\/p>\n<p><strong>concatenate<\/strong> To join two operands end to end.<\/p>\n<p><strong>descriptor<\/strong>\n<p>Any object which defines the methods&nbsp;__get__(),&nbsp;__set__(), or&nbsp;__delete__(). When a class attribute is a descriptor, its special binding behavior is triggered upon attribute lookup. Normally, using&nbsp;<em>a.b<\/em>&nbsp;to get, set or delete an attribute looks up the object named&nbsp;<em>b<\/em>&nbsp;in the class dictionary for&nbsp;<em>a<\/em>, but if&nbsp;<em>b<\/em>&nbsp;is a descriptor, the respective descriptor method gets called. Understanding descriptors is a key to a deep understanding of Python because they are the basis for many features including functions, methods, properties, class methods, static methods, and reference to super classes.<\/p>\n<p>For more information about descriptors\u2019 methods, see&nbsp;Implementing Descriptors.<\/p>\n<p><strong>dictionary<\/strong>\n<p>An associative array, where arbitrary keys are mapped to values. The keys can be any object with&nbsp;__hash__()&nbsp;and&nbsp;__eq__()&nbsp;methods. Called a hash in Perl.<\/p>\n<p><strong>evaluate<\/strong>\n<p>To simplify an expression by performing the operations in order to yield a single value.<\/p>\n<p><strong>expression<\/strong>\n<p>A piece of syntax which can be evaluated to some value. In other words, an expression is an accumulation of expression elements like literals, names, attribute access, operators or function calls which all return a value. In contrast to many other languages, not all language constructs are expressions. There are also&nbsp;statements which cannot be used as expressions, such as&nbsp;if. Assignments are also statements, not expressions.<\/p>\n<p><strong>file object<\/strong>\n<p>An object exposing a file-oriented API (with methods such as&nbsp;read()&nbsp;or&nbsp;write()) to an underlying resource. Depending on the way it was created, a file object can mediate access to a real on-disk file or to another type of storage or communication device (for example standard input\/output, in-memory buffers, sockets, pipes, etc.). File objects are also called&nbsp;<em>file-like objects<\/em>&nbsp;or&nbsp;<em>streams<\/em>.\n<p>There are actually three categories of file objects: raw&nbsp;binary files, buffered&nbsp;binary files&nbsp;and&nbsp;text files. Their interfaces are defined in the&nbsp;io&nbsp;module. The canonical way to create a file object is by using the&nbsp;open()function.<\/p>\n<p><strong>floating point<\/strong>\n<p>A type that represents numbers with fractional parts.<\/strong>\n<p><strong>function<\/strong>\n<p>A series of statements which returns some value to a caller. It can also be passed zero or more&nbsp;arguments which may be used in the execution of the body. See also&nbsp;parameter,&nbsp;method, and the&nbsp;Function definitionssection.<\/p>\n<p><strong>garbage collection<\/strong>\n<p>The process of freeing memory when it is not used anymore. Python performs garbage collection via reference counting and a cyclic garbage collector that is able to detect and break reference cycles. The garbage collector can be controlled using the&nbsp;gc&nbsp;module.<\/p>\n<p><strong>IDLE<\/strong>\n<p>An Integrated Development Environment for Python. IDLE is a basic editor and interpreter environment which ships with the standard distribution of Python.<\/p>\n<p><strong>integer<\/strong>\n<p>A type that represents whole numbers.<\/p>\n<p><strong>immutable<\/strong>\n<p>An object with a fixed value. Immutable objects include numbers, strings and tuples. Such an object cannot be altered. A new object has to be created if a different value has to be stored. They play an important role in places where a constant hash value is needed, for example as a key in a dictionary.<\/p>\n<p><strong>interactive<\/strong>\n<p>Python has an interactive interpreter which means you can enter statements and expressions at the interpreter prompt, immediately execute them and see their results. Just launch&nbsp;python&nbsp;with no arguments (possibly by selecting it from your computer\u2019s main menu). It is a very powerful way to test out new ideas or inspect modules and packages (remember&nbsp;help(x)).<\/p>\n<p><strong>interpreted<\/strong>\n<p>Python is an interpreted language, as opposed to a compiled one, though the distinction can be blurry because of the presence of the bytecode compiler. This means that source files can be run directly without explicitly creating an executable which is then run. Interpreted languages typically have a shorter development\/debug cycle than compiled ones, though their programs generally also run more slowly. See also&nbsp;interactive.<\/p>\n<p><strong>list<\/strong>\n<p>A built-in Python&nbsp;sequence. Despite its name it is more akin to an array in other languages than to a linked list since access to elements is O(1).<\/p>\n<p><strong>low-level language<\/strong>\n<p>A programming language that is designed to be easy for a computer to execute; also called \u201cmachine code\u201d or \u201cassembly language\u201d.<\/p>\n<p><strong>machine code<\/strong>\n<p>The lowest-level language for software, which is the language that<\/p>\n<p>is directly executed by the central processing unit (CPU).<\/p>\n<p><strong>main memory<\/strong> Stores programs and data. Main memory loses its information<\/p>\n<p>when the power is turned off.<\/p>\n<p><strong>method<\/strong>\n<p>A function which is defined inside a class body. If called as an attribute of an instance of that class, the method will get the instance object as its first&nbsp;argument&nbsp;(which is usually called&nbsp;self). See&nbsp;function&nbsp;and&nbsp;nested scope.<\/p>\n<p><strong>module<\/strong>\n<p>An object that serves as an organizational unit of Python code. Modules have a namespace containing arbitrary Python objects. Modules are loaded into Python by the process of&nbsp;importing.<\/p>\n<p><strong>mutable<\/strong>\n<p>Mutable objects can change their value but keep their&nbsp;id(). See also&nbsp;immutable.<\/p>\n<p><strong>object<\/strong>\n<p>A constructed instance of a class. An object contains all of the attributes and methods that were defined by the class. Some object-oriented documentation uses the term \u2018instance\u2019 interchangeably with \u2018object\u2019<\/p>\n<p><strong>package<\/strong>\n<p>A Python&nbsp;module&nbsp;which can contain submodules or recursively, subpackages. Technically, a package is a Python module with an&nbsp;__path__&nbsp;attribute.<\/p>\n<p>See also&nbsp;regular package&nbsp;and&nbsp;namespace package.<\/p>\n<p><strong>parameter<\/strong>\n<p>A named entity in a&nbsp;function&nbsp;(or method) definition that specifies an&nbsp;argument&nbsp;(or in some cases, arguments) that the function can accept. There are five kinds of parameter:<\/p>\n<ul>\n<li><em>positional-or-keyword<\/em>: specifies an argument that can be passed either&nbsp;positionally&nbsp;or as a&nbsp;keyword argument. This is the default kind of parameter, for example&nbsp;<em>foo<\/em>&nbsp;and&nbsp;<em>bar<\/em>&nbsp;in the following:<\/li>\n<li><strong>def<\/strong> func(foo, bar=<strong>None<\/strong>): ...<\/li>\n<\/ul>\n<ul>\n<li><em>positional-only<\/em>: specifies an argument that can be supplied only by position. Python has no syntax for defining positional-only parameters. However, some built-in functions have positional-only parameters (e.g.&nbsp;abs()).<\/li>\n<\/ul>\n<ul>\n<li><em>keyword-only<\/em>: specifies an argument that can be supplied only by keyword. Keyword-only parameters can be defined by including a single var-positional parameter or bare&nbsp;*&nbsp;in the parameter list of the function definition before them, for example&nbsp;<em>kw_only1<\/em>&nbsp;and&nbsp;<em>kw_only2<\/em>&nbsp;in the following:<\/li>\n<li><strong>def<\/strong> func(arg, *, kw_only1, kw_only2): ...<\/li>\n<li><em>var-positional<\/em>: specifies that an arbitrary sequence of positional arguments can be provided (in addition to any positional arguments already accepted by other parameters). Such a parameter can be defined by prepending the parameter name with&nbsp;*, for example&nbsp;<em>args<\/em>&nbsp;in the following:<\/li>\n<li><strong>def<\/strong> func(*args, **kwargs): ...<\/li>\n<li><em>var-keyword<\/em>: specifies that arbitrarily many keyword arguments can be provided (in addition to any keyword arguments already accepted by other parameters). Such a parameter can be defined by prepending the parameter name with&nbsp;**, for example&nbsp;<em>kwargs<\/em>&nbsp;in the example above.<\/li>\n<\/ul>\n<p>Parameters can specify both optional and required arguments, as well as default values for some optional arguments.<\/p>\n<p><strong>high-level language<\/strong>\n<p>A programming language like Python that is designed to<\/p>\n<p>be easy for humans to read and write.<\/p>\n<p><strong>interactive mode<\/strong>\n<p>A way of using the Python interpreter by typing commands<\/p>\n<p>and expressions at the prompt.<\/p>\n<p><strong>interpret<\/strong>\n<p>To execute a program in a high-level language by translating it one line<\/p>\n<p>at a time.<\/p>\n<p><strong>keyword<\/strong>\n<p>A reserved word that is used by the compiler to parse a program; you cannot use keywords like if, def, and while as variable names.<\/p>\n<p><strong>modulus operator<\/strong>\n<p>An operator, denoted with a percent sign (%), that works on integers and yields the remainder when one number is divided by another.<\/p>\n<p><strong>nested conditional<\/strong>\n<p>A conditional statement that appears in one of the branches of another conditional statement.<\/p>\n<p><strong>operand<\/strong>\n<p>One of the values on which an operator operates.<\/p>\n<p><strong>operator <\/strong>A special symbol that represents a simple computation like addition, multiplication, or string concatenation.<\/p>\n<p><strong>parse <\/strong>to examine a program and analyze the syntactic structure.<\/p>\n<p><strong>Python 3000<\/strong>\n<p>Nickname for the Python 3.x release line (coined long ago when the release of version 3 was something in the distant future.) This is also abbreviated \u201cPy3k\u201d.<\/p>\n<p><strong>rules of precedence<\/strong>\n<p>The set of rules governing the order in which expressions involving multiple operators and operands are evaluated.<\/p>\n<p><strong>statement<\/strong>\n<p>A statement is part of a suite (a \u201cblock\u201d of code). A statement is either an&nbsp;expression&nbsp;or one of several constructs with a keyword, such as&nbsp;if,&nbsp;while&nbsp;or&nbsp;for.<\/p>\n<p><strong>string<\/strong>\n<p>A type that represents sequences of characters.<\/p>\n<p><strong>text encoding<\/strong>\n<p>A codec which encodes Unicode strings to bytes.<\/p>\n<p><strong>text file<\/strong>\n<p>A&nbsp;file object&nbsp;able to read and write&nbsp;str&nbsp;objects. Often, a text file actually accesses a byte-oriented datastream and handles the&nbsp;text encoding&nbsp;automatically. Examples of text files are files opened in text mode ('r'&nbsp;or&nbsp;'w'),&nbsp;sys.stdin,&nbsp;sys.stdout, and instances of&nbsp;io.StringIO.<\/p>\n<p>See also&nbsp;binary file&nbsp;for a file object able to read and write&nbsp;bytes-like objects.<\/p>\n<p><strong>triple-quoted string<\/strong>\n<p>A string which is bound by three instances of either a quotation mark (\u201c) or an apostrophe (\u2018). While they don\u2019t provide any functionality not available with single-quoted strings, they are useful for a number of reasons. They allow you to include unescaped single and double quotes within a string and they can span multiple lines without the use of the continuation character, making them especially useful when writing docstrings.<\/p>\n<p><strong>type<\/strong>\n<p>The type of a Python object determines what kind of object it is; every object has a type. An object\u2019s type is accessible as its&nbsp;__class__&nbsp;attribute or can be retrieved with&nbsp;type(obj).<\/p>\n<p><strong>value<\/strong>\n<p>One of the basic units of data, like a number or string, that a program manipulates.<\/p>\n<p><strong>&nbsp;variable<\/strong>\n<p>A name that refers to a value.<\/p>\n<p><strong>variable annotation<\/strong>\n<p>An&nbsp;annotation&nbsp;of a variable or a class attribute.<\/p>\n<p>When annotating a variable or a class attribute, assignment is optional:<\/p>\n<p><strong>class<\/strong> C<\/strong>:\n<p>field: 'annotation'<\/p>\n<p>Variable annotations are usually used for&nbsp;type hints: for example this variable is expected to take&nbsp;int&nbsp;values:<\/p>\n<p>count: int = 0<\/p>\n<p><strong>virtual environment<\/strong>\n<p>A cooperatively isolated runtime environment that allows Python users and applications to install and upgrade Python distribution packages without interfering with the behaviour of other Python applications running on the same system.<\/p>\n<p>See also&nbsp;venv.<\/p>\n<p><strong>virtual machine<\/strong>\n<p>A computer defined entirely in software. Python\u2019s virtual machine executes the&nbsp;bytecode&nbsp;emitted by the bytecode compiler.<\/p>\n\n","rendered":"<p><strong>argument<\/strong>\n<\/p>\n<p>A value passed to a&nbsp;function&nbsp;(or&nbsp;method) when calling the function. There are two kinds of argument:<\/p>\n<ul>\n<li><em>keyword argument<\/em>: an argument preceded by an identifier (e.g.&nbsp;name=) in a function call or passed as a value in a dictionary preceded by&nbsp;**. For example,&nbsp;3&nbsp;and&nbsp;5&nbsp;are both keyword arguments in the following calls to&nbsp;complex():<\/li>\n<li>complex(real=3, imag=5)<\/li>\n<li>complex(**{&#8216;real&#8217;: 3, &#8216;imag&#8217;: 5})<\/li>\n<li><em>positional argument<\/em>: an argument that is not a keyword argument. Positional arguments can appear at the beginning of an argument list and\/or be passed as elements of an&nbsp;iterable&nbsp;preceded by&nbsp;*. For example,&nbsp;3&nbsp;and&nbsp;5&nbsp;are both positional arguments in the following calls:<\/li>\n<li>complex(3, 5)<\/li>\n<li>complex(*(3, 5))<\/li>\n<\/ul>\n<p>Arguments are assigned to the named local variables in a function body. See the&nbsp;Calls&nbsp;section for the rules governing this assignment. Syntactically, any expression can be used to represent an argument; the evaluated value is assigned to the local variable.<\/p>\n<p><strong>assignment<\/strong>\n<\/p>\n<p>A statement that assigns a value to a variable.<\/p>\n<p><strong>attribute<\/strong>\n<\/p>\n<p>A value associated with an object which is referenced by name using dotted expressions. For example, if an object&nbsp;<em>o<\/em>&nbsp;has an attribute&nbsp;<em>a<\/em>&nbsp;it would be referenced as&nbsp;<em>o.a<\/em>.\n<\/p>\n<p><strong>body<\/strong>\n<\/p>\n<p>The sequence of statements within a compound statement.<\/p>\n<p><strong>boolean expression<\/strong>\n<\/p>\n<p>An expression whose value is either True or False.<\/p>\n<p><strong>branch<\/strong>\n<\/p>\n<p>One of the alternative sequences of statements in a conditional statement.<\/p>\n<p><strong>bug<\/strong>\n<\/p>\n<p>An error in a program.<\/p>\n<p><strong>bytecode<\/strong>\n<\/p>\n<p>Python source code is compiled into bytecode, the internal representation of a Python program in the CPython interpreter. The bytecode is also cached in&nbsp;.pyc&nbsp;files so that executing the same file is faster the second time (recompilation from source to bytecode can be avoided). This \u201cintermediate language\u201d is said to run on a&nbsp;virtual machine&nbsp;that executes the machine code corresponding to each bytecode. Do note that bytecodes are not expected to work between different Python virtual machines, nor to be stable between Python releases.<\/p>\n<p><strong>central processing unit<\/strong>\n<\/p>\n<p>The heart of any computer. It is what runs the software<\/p>\n<p>that we write; also called \u201cCPU\u201d or \u201cthe processor\u201d.<\/p>\n<p><strong>chained conditional<\/strong>\n<\/p>\n<p>A conditional statement with a series of alternative branches<\/p>\n<p><strong>class<\/strong>\n<\/p>\n<p>A template for creating user-defined objects. Class definitions normally contain method definitions which operate on instances of the class.<\/p>\n<p><strong>class variable<\/strong>\n<\/p>\n<p>A variable defined in a class and intended to be modified only at class level (i.e., not in an instance of the class).<\/p>\n<p><strong>comment<\/strong> Information in a program that is meant for other programmers (or anyone reading the source code) and has no effect on the execution of the program.<\/p>\n<p><strong>compile<\/strong>\n<\/p>\n<p>To translate a program written in a high-level language into a low-level<\/p>\n<p>language all at once, in preparation for later execution.<\/p>\n<p><strong>concatenate<\/strong> To join two operands end to end.<\/p>\n<p><strong>descriptor<\/strong>\n<\/p>\n<p>Any object which defines the methods&nbsp;__get__(),&nbsp;__set__(), or&nbsp;__delete__(). When a class attribute is a descriptor, its special binding behavior is triggered upon attribute lookup. Normally, using&nbsp;<em>a.b<\/em>&nbsp;to get, set or delete an attribute looks up the object named&nbsp;<em>b<\/em>&nbsp;in the class dictionary for&nbsp;<em>a<\/em>, but if&nbsp;<em>b<\/em>&nbsp;is a descriptor, the respective descriptor method gets called. Understanding descriptors is a key to a deep understanding of Python because they are the basis for many features including functions, methods, properties, class methods, static methods, and reference to super classes.<\/p>\n<p>For more information about descriptors\u2019 methods, see&nbsp;Implementing Descriptors.<\/p>\n<p><strong>dictionary<\/strong>\n<\/p>\n<p>An associative array, where arbitrary keys are mapped to values. The keys can be any object with&nbsp;__hash__()&nbsp;and&nbsp;__eq__()&nbsp;methods. Called a hash in Perl.<\/p>\n<p><strong>evaluate<\/strong>\n<\/p>\n<p>To simplify an expression by performing the operations in order to yield a single value.<\/p>\n<p><strong>expression<\/strong>\n<\/p>\n<p>A piece of syntax which can be evaluated to some value. In other words, an expression is an accumulation of expression elements like literals, names, attribute access, operators or function calls which all return a value. In contrast to many other languages, not all language constructs are expressions. There are also&nbsp;statements which cannot be used as expressions, such as&nbsp;if. Assignments are also statements, not expressions.<\/p>\n<p><strong>file object<\/strong>\n<\/p>\n<p>An object exposing a file-oriented API (with methods such as&nbsp;read()&nbsp;or&nbsp;write()) to an underlying resource. Depending on the way it was created, a file object can mediate access to a real on-disk file or to another type of storage or communication device (for example standard input\/output, in-memory buffers, sockets, pipes, etc.). File objects are also called&nbsp;<em>file-like objects<\/em>&nbsp;or&nbsp;<em>streams<\/em>.\n<\/p>\n<p>There are actually three categories of file objects: raw&nbsp;binary files, buffered&nbsp;binary files&nbsp;and&nbsp;text files. Their interfaces are defined in the&nbsp;io&nbsp;module. The canonical way to create a file object is by using the&nbsp;open()function.<\/p>\n<p><strong>floating point<\/strong>\n<\/p>\n<p>A type that represents numbers with fractional parts.\n<\/p>\n<p><strong>function<\/strong>\n<\/p>\n<p>A series of statements which returns some value to a caller. It can also be passed zero or more&nbsp;arguments which may be used in the execution of the body. See also&nbsp;parameter,&nbsp;method, and the&nbsp;Function definitionssection.<\/p>\n<p><strong>garbage collection<\/strong>\n<\/p>\n<p>The process of freeing memory when it is not used anymore. Python performs garbage collection via reference counting and a cyclic garbage collector that is able to detect and break reference cycles. The garbage collector can be controlled using the&nbsp;gc&nbsp;module.<\/p>\n<p><strong>IDLE<\/strong>\n<\/p>\n<p>An Integrated Development Environment for Python. IDLE is a basic editor and interpreter environment which ships with the standard distribution of Python.<\/p>\n<p><strong>integer<\/strong>\n<\/p>\n<p>A type that represents whole numbers.<\/p>\n<p><strong>immutable<\/strong>\n<\/p>\n<p>An object with a fixed value. Immutable objects include numbers, strings and tuples. Such an object cannot be altered. A new object has to be created if a different value has to be stored. They play an important role in places where a constant hash value is needed, for example as a key in a dictionary.<\/p>\n<p><strong>interactive<\/strong>\n<\/p>\n<p>Python has an interactive interpreter which means you can enter statements and expressions at the interpreter prompt, immediately execute them and see their results. Just launch&nbsp;python&nbsp;with no arguments (possibly by selecting it from your computer\u2019s main menu). It is a very powerful way to test out new ideas or inspect modules and packages (remember&nbsp;help(x)).<\/p>\n<p><strong>interpreted<\/strong>\n<\/p>\n<p>Python is an interpreted language, as opposed to a compiled one, though the distinction can be blurry because of the presence of the bytecode compiler. This means that source files can be run directly without explicitly creating an executable which is then run. Interpreted languages typically have a shorter development\/debug cycle than compiled ones, though their programs generally also run more slowly. See also&nbsp;interactive.<\/p>\n<p><strong>list<\/strong>\n<\/p>\n<p>A built-in Python&nbsp;sequence. Despite its name it is more akin to an array in other languages than to a linked list since access to elements is O(1).<\/p>\n<p><strong>low-level language<\/strong>\n<\/p>\n<p>A programming language that is designed to be easy for a computer to execute; also called \u201cmachine code\u201d or \u201cassembly language\u201d.<\/p>\n<p><strong>machine code<\/strong>\n<\/p>\n<p>The lowest-level language for software, which is the language that<\/p>\n<p>is directly executed by the central processing unit (CPU).<\/p>\n<p><strong>main memory<\/strong> Stores programs and data. Main memory loses its information<\/p>\n<p>when the power is turned off.<\/p>\n<p><strong>method<\/strong>\n<\/p>\n<p>A function which is defined inside a class body. If called as an attribute of an instance of that class, the method will get the instance object as its first&nbsp;argument&nbsp;(which is usually called&nbsp;self). See&nbsp;function&nbsp;and&nbsp;nested scope.<\/p>\n<p><strong>module<\/strong>\n<\/p>\n<p>An object that serves as an organizational unit of Python code. Modules have a namespace containing arbitrary Python objects. Modules are loaded into Python by the process of&nbsp;importing.<\/p>\n<p><strong>mutable<\/strong>\n<\/p>\n<p>Mutable objects can change their value but keep their&nbsp;id(). See also&nbsp;immutable.<\/p>\n<p><strong>object<\/strong>\n<\/p>\n<p>A constructed instance of a class. An object contains all of the attributes and methods that were defined by the class. Some object-oriented documentation uses the term \u2018instance\u2019 interchangeably with \u2018object\u2019<\/p>\n<p><strong>package<\/strong>\n<\/p>\n<p>A Python&nbsp;module&nbsp;which can contain submodules or recursively, subpackages. Technically, a package is a Python module with an&nbsp;__path__&nbsp;attribute.<\/p>\n<p>See also&nbsp;regular package&nbsp;and&nbsp;namespace package.<\/p>\n<p><strong>parameter<\/strong>\n<\/p>\n<p>A named entity in a&nbsp;function&nbsp;(or method) definition that specifies an&nbsp;argument&nbsp;(or in some cases, arguments) that the function can accept. There are five kinds of parameter:<\/p>\n<ul>\n<li><em>positional-or-keyword<\/em>: specifies an argument that can be passed either&nbsp;positionally&nbsp;or as a&nbsp;keyword argument. This is the default kind of parameter, for example&nbsp;<em>foo<\/em>&nbsp;and&nbsp;<em>bar<\/em>&nbsp;in the following:<\/li>\n<li><strong>def<\/strong> func(foo, bar=<strong>None<\/strong>): &#8230;<\/li>\n<\/ul>\n<ul>\n<li><em>positional-only<\/em>: specifies an argument that can be supplied only by position. Python has no syntax for defining positional-only parameters. However, some built-in functions have positional-only parameters (e.g.&nbsp;abs()).<\/li>\n<\/ul>\n<ul>\n<li><em>keyword-only<\/em>: specifies an argument that can be supplied only by keyword. Keyword-only parameters can be defined by including a single var-positional parameter or bare&nbsp;*&nbsp;in the parameter list of the function definition before them, for example&nbsp;<em>kw_only1<\/em>&nbsp;and&nbsp;<em>kw_only2<\/em>&nbsp;in the following:<\/li>\n<li><strong>def<\/strong> func(arg, *, kw_only1, kw_only2): &#8230;<\/li>\n<li><em>var-positional<\/em>: specifies that an arbitrary sequence of positional arguments can be provided (in addition to any positional arguments already accepted by other parameters). Such a parameter can be defined by prepending the parameter name with&nbsp;*, for example&nbsp;<em>args<\/em>&nbsp;in the following:<\/li>\n<li><strong>def<\/strong> func(*args, **kwargs): &#8230;<\/li>\n<li><em>var-keyword<\/em>: specifies that arbitrarily many keyword arguments can be provided (in addition to any keyword arguments already accepted by other parameters). Such a parameter can be defined by prepending the parameter name with&nbsp;**, for example&nbsp;<em>kwargs<\/em>&nbsp;in the example above.<\/li>\n<\/ul>\n<p>Parameters can specify both optional and required arguments, as well as default values for some optional arguments.<\/p>\n<p><strong>high-level language<\/strong>\n<\/p>\n<p>A programming language like Python that is designed to<\/p>\n<p>be easy for humans to read and write.<\/p>\n<p><strong>interactive mode<\/strong>\n<\/p>\n<p>A way of using the Python interpreter by typing commands<\/p>\n<p>and expressions at the prompt.<\/p>\n<p><strong>interpret<\/strong>\n<\/p>\n<p>To execute a program in a high-level language by translating it one line<\/p>\n<p>at a time.<\/p>\n<p><strong>keyword<\/strong>\n<\/p>\n<p>A reserved word that is used by the compiler to parse a program; you cannot use keywords like if, def, and while as variable names.<\/p>\n<p><strong>modulus operator<\/strong>\n<\/p>\n<p>An operator, denoted with a percent sign (%), that works on integers and yields the remainder when one number is divided by another.<\/p>\n<p><strong>nested conditional<\/strong>\n<\/p>\n<p>A conditional statement that appears in one of the branches of another conditional statement.<\/p>\n<p><strong>operand<\/strong>\n<\/p>\n<p>One of the values on which an operator operates.<\/p>\n<p><strong>operator <\/strong>A special symbol that represents a simple computation like addition, multiplication, or string concatenation.<\/p>\n<p><strong>parse <\/strong>to examine a program and analyze the syntactic structure.<\/p>\n<p><strong>Python 3000<\/strong>\n<\/p>\n<p>Nickname for the Python 3.x release line (coined long ago when the release of version 3 was something in the distant future.) This is also abbreviated \u201cPy3k\u201d.<\/p>\n<p><strong>rules of precedence<\/strong>\n<\/p>\n<p>The set of rules governing the order in which expressions involving multiple operators and operands are evaluated.<\/p>\n<p><strong>statement<\/strong>\n<\/p>\n<p>A statement is part of a suite (a \u201cblock\u201d of code). A statement is either an&nbsp;expression&nbsp;or one of several constructs with a keyword, such as&nbsp;if,&nbsp;while&nbsp;or&nbsp;for.<\/p>\n<p><strong>string<\/strong>\n<\/p>\n<p>A type that represents sequences of characters.<\/p>\n<p><strong>text encoding<\/strong>\n<\/p>\n<p>A codec which encodes Unicode strings to bytes.<\/p>\n<p><strong>text file<\/strong>\n<\/p>\n<p>A&nbsp;file object&nbsp;able to read and write&nbsp;str&nbsp;objects. Often, a text file actually accesses a byte-oriented datastream and handles the&nbsp;text encoding&nbsp;automatically. Examples of text files are files opened in text mode (&#8216;r&#8217;&nbsp;or&nbsp;&#8216;w&#8217;),&nbsp;sys.stdin,&nbsp;sys.stdout, and instances of&nbsp;io.StringIO.<\/p>\n<p>See also&nbsp;binary file&nbsp;for a file object able to read and write&nbsp;bytes-like objects.<\/p>\n<p><strong>triple-quoted string<\/strong>\n<\/p>\n<p>A string which is bound by three instances of either a quotation mark (\u201c) or an apostrophe (\u2018). While they don\u2019t provide any functionality not available with single-quoted strings, they are useful for a number of reasons. They allow you to include unescaped single and double quotes within a string and they can span multiple lines without the use of the continuation character, making them especially useful when writing docstrings.<\/p>\n<p><strong>type<\/strong>\n<\/p>\n<p>The type of a Python object determines what kind of object it is; every object has a type. An object\u2019s type is accessible as its&nbsp;__class__&nbsp;attribute or can be retrieved with&nbsp;type(obj).<\/p>\n<p><strong>value<\/strong>\n<\/p>\n<p>One of the basic units of data, like a number or string, that a program manipulates.<\/p>\n<p><strong>&nbsp;variable<\/strong>\n<\/p>\n<p>A name that refers to a value.<\/p>\n<p><strong>variable annotation<\/strong>\n<\/p>\n<p>An&nbsp;annotation&nbsp;of a variable or a class attribute.<\/p>\n<p>When annotating a variable or a class attribute, assignment is optional:<\/p>\n<p><strong>class<\/strong> C:\n<\/p>\n<p>field: &#8216;annotation&#8217;<\/p>\n<p>Variable annotations are usually used for&nbsp;type hints: for example this variable is expected to take&nbsp;int&nbsp;values:<\/p>\n<p>count: int = 0<\/p>\n<p><strong>virtual environment<\/strong>\n<\/p>\n<p>A cooperatively isolated runtime environment that allows Python users and applications to install and upgrade Python distribution packages without interfering with the behaviour of other Python applications running on the same system.<\/p>\n<p>See also&nbsp;venv.<\/p>\n<p><strong>virtual machine<\/strong>\n<\/p>\n<p>A computer defined entirely in software. Python\u2019s virtual machine executes the&nbsp;bytecode&nbsp;emitted by the bytecode compiler.<\/p>\n","protected":false},"author":23485,"menu_order":3,"template":"","meta":{"_candela_citation":"[]","CANDELA_OUTCOMES_GUID":"","pb_show_title":"on","pb_short_title":"","pb_subtitle":"","pb_authors":[],"pb_section_license":""},"back-matter-type":[],"contributor":[],"license":[],"class_list":["post-89","back-matter","type-back-matter","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/courses.lumenlearning.com\/suny-albany-programmingforproblemsolving-v2\/wp-json\/pressbooks\/v2\/back-matter\/89","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/courses.lumenlearning.com\/suny-albany-programmingforproblemsolving-v2\/wp-json\/pressbooks\/v2\/back-matter"}],"about":[{"href":"https:\/\/courses.lumenlearning.com\/suny-albany-programmingforproblemsolving-v2\/wp-json\/wp\/v2\/types\/back-matter"}],"author":[{"embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/suny-albany-programmingforproblemsolving-v2\/wp-json\/wp\/v2\/users\/23485"}],"version-history":[{"count":1,"href":"https:\/\/courses.lumenlearning.com\/suny-albany-programmingforproblemsolving-v2\/wp-json\/pressbooks\/v2\/back-matter\/89\/revisions"}],"predecessor-version":[{"id":108,"href":"https:\/\/courses.lumenlearning.com\/suny-albany-programmingforproblemsolving-v2\/wp-json\/pressbooks\/v2\/back-matter\/89\/revisions\/108"}],"metadata":[{"href":"https:\/\/courses.lumenlearning.com\/suny-albany-programmingforproblemsolving-v2\/wp-json\/pressbooks\/v2\/back-matter\/89\/metadata\/"}],"wp:attachment":[{"href":"https:\/\/courses.lumenlearning.com\/suny-albany-programmingforproblemsolving-v2\/wp-json\/wp\/v2\/media?parent=89"}],"wp:term":[{"taxonomy":"back-matter-type","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/suny-albany-programmingforproblemsolving-v2\/wp-json\/pressbooks\/v2\/back-matter-type?post=89"},{"taxonomy":"contributor","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/suny-albany-programmingforproblemsolving-v2\/wp-json\/wp\/v2\/contributor?post=89"},{"taxonomy":"license","embeddable":true,"href":"https:\/\/courses.lumenlearning.com\/suny-albany-programmingforproblemsolving-v2\/wp-json\/wp\/v2\/license?post=89"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}