UPDATED ACTUAL Exam Questions and
CORRECT Answers
language - CORRECT ANSWER means/tool for expressing and recoding thoughts
computer's language? - CORRECT ANSWER machine language
natural languages - CORRECT ANSWER languages where new words are created every
day and old words disappear
4 aspects of a language - CORRECT ANSWER alphabet, lexis, syntax, semantics
alphabet - CORRECT ANSWER set of symbols used to build words of a certain language
lexis - CORRECT ANSWER aka a dictionary or a set of words the language offers its
users
syntax - CORRECT ANSWER a set of rules (formal or informal) used to determine if a
certain string of words forms a valid sentence
semantics - CORRECT ANSWER a set of rules determine if a certain phrase makes sense
(I ate a donut vs a donut ate me)
Instruction List (IL) - CORRECT ANSWER a complete set of known commands; the
alphabet of the machine language (they vary by size and what they contain)
source code - CORRECT ANSWER a program written in a high-level programming
language (in contrast to the machine code executed by computers)
source file - CORRECT ANSWER contains source code
two different ways of transforming a program from a high-level programming language into
machine language - CORRECT ANSWER compilation and interpretation
compilation - CORRECT ANSWER source program is translated once (must be repeated
each time you modify the source code) by getting a file containing the machine code; now you
can distribute the file worldwide. The program that performs this translation is called a compiler
or translator
interpretation - CORRECT ANSWER a user can translate the source program each time it
has to be run; the program performing this kind of transformation is called an interpreter, as it
interprets the code every time it is intended to be executed
,compilation advantages - CORRECT ANSWER -Execution of the translated code is
usually faster
-Only the user has to have the compiler, end user may use code without it
-Translated code is stored using machine language - because machine language is hard to
understand, this makes your own inventions/programming tricks likely to remain secret
compilation disadvantages - CORRECT ANSWER -Compilation itself maybe be very
time consuming; you might not be able to run code immediately after any change
-You have to have as many compilers as hardware platforms you want your code to be run on
interpretation advantages - CORRECT ANSWER -You can run the code as soon as you
complete it; no additional phases of translation
-Code is stored using programming language, not the machine one, which means it can be run on
computers using different machine languages
-You dont compile your code separately for each different architecture
interpretation disadvantages - CORRECT ANSWER -Code will share the computer's
power with the interpreter, so it can't be really fast
-Both you and the end user have to have the interpreter to run your code
Scripting languages - CORRECT ANSWER languages designed to be utilized in the
interpretation manner/ they create scripts
scripts - CORRECT ANSWER source programs encoded using scripting languages
Python aka CPython - CORRECT ANSWER the PSF implementation and the most
influential Python among all the Pythons in the world; the default implementation of the python
programming language
PSF - CORRECT ANSWER Python Software foundation; Pythons maintained by the PSF
are canonical and are reference pythons
editor - CORRECT ANSWER supports you in writing code
console - CORRECT ANSWER used to launch your newly written code and stop it
forcibly when it gets out of control
debugger - CORRECT ANSWER tool able to launch your code step by step and allowing
you to inspect it at each moment of execution
IDLE - CORRECT ANSWER Integrated Development and Learning Environment
,Error Codes - CORRECT ANSWER traceback, location of the error (Python shows the
place where it first notices the effects of the error, not necessarily the error itself), content of the
erroneous line, name of the error
What kind of language is Python? - CORRECT ANSWER a high-level programming
language (not a machine language or a natural language)
interpreter - CORRECT ANSWER A computer program that directly executes instructions
written in a programming language
literal - CORRECT ANSWER data whose values are determined by the literal itself and
are used to encode data and put them into your code (123 is literally one hundred and twenty-
three while C can = anything, so 123 is literal but C is not)
two types of numbers - CORRECT ANSWER integers and floats
type () - CORRECT ANSWER determines the kind, range, and application of the numeric
value
octal value prefix - CORRECT ANSWER integer preceded by an 0o; must contain digits
taken from 0....8 range only
hexadecimal value prefix - CORRECT ANSWER 0x (16 as its base)
escape character - CORRECT ANSWER \ (backslash); signifies that the character after the
\ has a different meaning
binary system - CORRECT ANSWER is a system of numbers that employs 2 as the base.
Therefore, a binary number is made up of 0s and 1s only, e.g., 1010 is 10 in decimal.
Integers (or simply ints) - CORRECT ANSWER Integers (or simply ints) are one of the
numerical types supported by Python. They are numbers written without a fractional component,
e.g., 256, or -1 (negative integers).
Floating-point numbers (or simply floats) - CORRECT ANSWER Floating-point numbers
(or simply floats) are another one of the numerical types supported by Python. They are numbers
that contain (or are able to contain) a fractional component, e.g., 1.27.
Boolean values - CORRECT ANSWER are the two constant objects True and False used
to represent truth values (in numeric contexts 1 is True, while 0 is False.
Classify these literals ("1.5", 2.0, 528, False) - CORRECT ANSWER string, numerical
literal float, numerical literal int, boolean literal
operator - CORRECT ANSWER Operators are special symbols or keywords which are
able to operate on the values and perform (mathematical) operations, e.g., the *operator
multiplies two values: x * y.
, + - CORRECT ANSWER operator that allows you to add numbers
** - CORRECT ANSWER is exponentiation; left argument is the base, the right is the
exponent, 2^3 is 2**3; uses right sided binding
/ - CORRECT ANSWER division; the value in front of hte slash is a dividend and the
value behind the slash is a divisor; Always produces a float
// - CORRECT ANSWER // is integer divisional operator also known as floor division;
results are always rounded to the lesser integer
integer vs. float rule - CORRECT ANSWER When both arguments are integers, the result
is an int; when at least one is a float, the result is a float too
% - CORRECT ANSWER modulo where the result is the remainder left after the integer
division
unary operator - CORRECT ANSWER is an operator with only one operand (-1 or +3)
binary operator - CORRECT ANSWER is an operator with two operands (4+5 or 12%5)
hierarchy of priorities - CORRECT ANSWER unary + and - have the highest priority
then: **,
then: *, /, and %
lowest priority: binary + and -.
binding - CORRECT ANSWER determines the order of computations performed by some
operators with equal priority, put side by side in one expression; most are left-sided binding (not
exponentiation)
expression - CORRECT ANSWER An expression is a combination of values (or variables,
operators, calls to functions) which evaluates to a value, e.g., 1 + 2.
simplest expression is a literal itself
function - CORRECT ANSWER a separate part of the computer code that is able to:
(some functions do both)
-Cause some effect (send txt to the terminal, create a file, draw an image, play a sound)
-Evaluate a value or some values (the square root of a value)That is, a function may have an
effect or a result
components of functions - CORRECT ANSWER an effect, a result, an argument within ()
newline - CORRECT ANSWER empty line of code