Front | Back |
What is a lexis?
|
A lexis, or dictionary, are the set of words a language offers its users.
|
What is a language's syntax?
|
A language's syntax is the set of rules used to determine if a certain statement is valid within the language.
|
Define semantics.
|
Semantics are a set of rules that determine whether or not a given phrase makes sense in a language.
|
What are the 4 language elements found in each language?
|
The 4 language elements are:
|
What is the difference between compiling and interpreting?
|
Compiled code is translated to assembly language via the compiler. The computer's architecture then translates the assembly language to machine language. This means to run a program requires an initial time investment (to translate to machine language) but runs quickly on subsequent runs. Interpreted code (aka scripts) is code that is fed into an application (the interpreter) which executes the code without needing to translate the source code into machine language. This makes running and testing scripts quicker initially, but because the interpreter has to talk to the machine on every run, the code is slower than an identical, compiled version of the code.
|
What are the advantages and disadvantages of compiling vs. interpreting code?
|
The contrasting pros/cons of compiled vs. interpreted code are thus:
|
What is a function?
|
A function is a distinct unit of code that can perform an actions and optionally return information to the caller (the code that calls the function).
|
What elements make up a function's invocation?
|
A function invocation consists of:
|
What does the Python interpreter do when it encounters a function invocation?
|
The interpreter performs the following actions:
|
What is the primary purpose of the print() function?
|
The print() function takes a variable-length list of variant type objects and sends them to the selected output device to be displayed.
|
What arguments does print() expect?
|
The print() function expects a list of 0 or more objects that can be output to a console.
|
What is an instruction?
|
An instruction is a specific command that can be evaluated by the Python interpreter. Instructions can flow onto multiple lines in the Python IDE, but multiple instructions cannot be contained on the same line.
|
Explain the concept of an escape character, and how to use it in Python.
|
The escape character is the backslash (\) character, and it tells the interpreter that the character following the backslash should not be considered part of a string literal, but rather a specific character (new line) or formatting instruction.
|
What is the newline escape sequence?
|
\n
|
What is the backslash escape sequence?
|
\\
|