(EXAM 1) QUESTIONS WITH CORRECT
ANSWERS!!
Machine language - ANSWER0's and 1's that contain instructions that can be
understood by a computer;
Compiled language - ANSWERCode written by programmer is reduced to a set of
machine-specific instructions prior to runtime; these then saved as an executable
that can be run (e.g., Ada, c/c++, Cobol, FORTRAN)
Interpreted language - ANSWERCode written by programmer is saved in the same
format as it was, which is then converted to machine-specific instructions at runtime;
often easier for developing code (e.g., JavaScript, Perl, Python, MATLAB)
Guido van Rossum - ANSWERCreated Python in the Netherlands in 1990
Python - ANSWERHigh-level, object-oriented programming language; used in
Google, NASA, NYSE
Compiler - ANSWERReads program and translates it completely before running it;
typically faster than its counterpart
Interpreter - ANSWERProcesses program little at a time; reads high-level language
and executes it
Integrated Development Environment (IDLE) - ANSWERSingle program that
provides tools to write, execute, and test a program; automatically installed with
Python; runs in interactive mode; has built in text editor
Program Development Cycle - ANSWERDesign, write code, correct syntax errors,
test, correct logic errors
Algorithm - ANSWERSet of well-defined logical steps that must be taken to perform
a task
Pseudocode - ANSWERFake code; informal language that has no syntax rules; not
meant to be compiled or executed; no worry of syntax errors so can focus on
program design; can be translated directly to code in any programming language
Assignment statement - ANSWERExpression used to create and give value to a
variable
False, True, & None - ANSWEROnly Python keywords with capital letters
, Integers - ANSWERWhole numbers; no fractional parts; can be positive,negative, or
zero; to print( ), does not need quotes
Real/Floating point numbers - ANSWERNumbers with a decimal point; have
fractional parts (1/2, 1/4,...); can be positive or negative; to print( ), does not need
quotes
Flowchart - ANSWERDiagram that graphically depicts the steps in a program;
ovals=terminals, parallelograms=input/output, rectangles=processing,
diamond=if statement
Statement - ANSWERA program instruction; execute in order, top to bottom
Expression - ANSWERCode that returns a value when entered; combination of
values, literals, variables, and operators
Function - ANSWERPiece of prewritten code that performs an operation
Argument - ANSWERData given to a function
String - ANSWERSequence of characters that is used as data
String literal - ANSWERString that appears in actual code of a program; must be
enclosed in single or double quotes
End-line comment - ANSWERAppears at the end of a line of code; typically explains
purpose of that line
Object - ANSWERCreated to represent value assigned to a variable; interpreter
creates and manipulates to run code
Variable - ANSWERName that refers to a value; used to access and manipulate data
stored in memory; can be passed as an argument to a function; name cannot start
with a digit; can only use if it has assigned value
..., end=' ') - ANSWERPrints a space between two statements
\n - ANSWERNewline character; causes output to the next line
\t - ANSWERHorizontal tab; causes following statement to tab over
\' or \" - ANSWERTo print single or double quotes within a string
Rules for naming variables - ANSWERCannot be Python keyword; cannot contain
spaces; first character must be letter or underscore, after which letters, digits or
underscores may be used; case sensitive; use meaningful one
and, as, assert - ANSWERA Python keywords
break - ANSWERB Python keywords