Python Certified Entry-Level Programmer (PCEP-30-XX) Study Cards

These flash cards follow along with the Python Institute's OpenEDG coursework and PCEP-30-XX exam syllabus

20 cards   |   Total Attempts: 197
  

Cards In This Set

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:
  1. An alphabet
  2. A lexis/dictionary
  3. Syntax Rules
  4. Semantics
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:
  1. Compiled code is faster in subsequent executions than interpreted code as the code is already in machine language.
  2. Interpreted code is easier to debug/modify as the code does not need to be recompiled after every change.
  3. Compiled code can run on any machine that uses the same architecture as the architecture in which the compiled code is compiled.
  4. Interpreted code is architecture independent, but does require the interpreter program to be installed on any client system that will run the code.
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:
  1. The function name
  2. Parentheses
  3. The argument list
What does the Python interpreter do when it encounters a function invocation?
The interpreter performs the following actions:
  1. Check that the function name is legal/exists
  2. Ensures that the number of arguments supplied conform to the number of arguments required for the function
  3. Interpreter passes flow control to the function block
  4. Evaluates the function
  5. Returns flow control to the caller
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?
\\