Python programming

Ace your homework & exams now with Quizwiz!

type

a category of values, such as integers, strings, and floating-point numbers

nested conditional

a conditional statement that appears in one of the branches of another conditional statement

chained conditional

a conditional statement with a series of alternative branches

void function

a function that does not return a value

fruitful function

a function that returns a value

algorithm

a general process for solving a category of problems

traceback

a list of the functions that are executing, printed when an exception occurs

mnemonic

a memory aid; it is good to give variables this type of name

variable

a name that refers to a value

parameter

a name used inside a function to refer to the value passed as an argument

function

a named sequence of statements that performs some useful operation; it may or may not take arguments and may or may not produce a result

source code

a program in a high-level language

high-level language

a programming language like Python that is designed to be easy for humans to read and write

low-level language

a programming language that is designed to be easy for a computer to execute; also called "machine code" or "assembly language"

portability

a property of a program that can run on more than one kind of computer

keyword

a reserved word that is used by the compiler to parse a program, such as "if" "def" and "while" in python, that you cannot use as variable names

statement

a section of code that represents a command or action

program

a set of instructions that specifies a computation

operator

a special symbol that represents a simple computation like addition, multiplication, or string concatenation

compound statement

a statement that consists of a header and a body; in Python the header ends with a colon (:) and the body is indented relative to the header

conditional statement

a statement that controls the flow of execution depending on some condition

function definition

a statement that creates a new function, specifying its name, parameters, and the statements it executes

function call

a statement that executes a function, consisting of a function name followed by an argument list

assignment

a statement that gives a value to a variable

import statement

a statement that reads a module file and creates a module object

string

a type that represents a sequence of characters

floating point

a type that represents numbers with fractional parts

integer

a type that represents whole numbers

function object

a value created by a function definition; the function name is a variable referring to it

module object

a value created by the import statement that provides access to the data and code defined in the module

argument

a value provided to a function when the function is called; this value is assigned to the corresponding parameter in the function

interactive mode

a way of using the Python interpreter by typing expressions and commands at the prompt

bug

an error in a program

semantic error

an error in a program that makes it do something other than what the programmer intended

boolean expression

an expression whose value is either 'True' or 'False'

print statement

an instruction that causes the Python interpreter to display a value on the screen

comparison operator

an operator such as ==, !=, >, <, <=, >= that compares operands

modulus operator

an operator, denoted with a percent sign (%) that works on integers and yields the remainder when one number is divided by another

expression

combination of variables, operators, and values that represents a single result type

compile

to translate a program written in a high-level language into a low-level language all at once, in preparation for later execution

composition

using an expression as part of a larger expression, or a statement as part of a larger statement

short circuit

when Python is part-way through evaluating a logical expression and stops evaluating because Python knows the final value of the expression without needing to evaluate the rest

prompt

when a program displays a message and pauses for the user to type some input to the program

guardian pattern

where we construct a logical expression with additional comparisons to take advantage of short-circuit behavior, such as preventing the program from trying to divide by zero

comment

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

branch

one of the alternative sequences of statements in a conditional statement

value

one of the basic units of data, like a number or a string, that a program manipulates

logical operator

one of the operators that combines boolean expressions, in Python 'and', 'or', and 'not'

operand

one of the values on which an operator operates

deterministic

pertaining to a program that does the same thing each time it runs, given the same inputs

pseudorandom

pertaining to a sequence of numbers that appear to be random, but are generated by a deterministic program

secondary memory

stores programs and data and retains its information even when the power is turned off; generally slower than main memory; examples include flash drives and disk drives

main memory

stores programs and data, loses its information when the power is turned off

condition

the boolean expression in a conditional statement that determines which branch is executed

header

the first line of a function definition

central processing unit

the heart of any computer, that runs the software we write, aka "the processor"

machine code

the lowest-level language for software, which is the language that is directly executed by the central processing unit (CPU)

semantics

the meaning of a program

floor division

the operation that divides two numbers and chops off the fractional part

flow of execution

the order in which statements are executed during a program run

problem solving

the process of formulating a problem, finding a solution, and expressing the solution

return value

the result of a function; the value of the expression if a function call is used as an expression

body

the sequence of statements inside a function definition

body

the sequence of statements within a compound statement

rules of precedence

the set of rules governing the order in which expressions involving multiple operators and operands are evaluated

dot notation

the syntax for calling a function in another module by specifying the module name followed by a period, and then the function name

parse

to examine a program and analyze the syntactic structure

interpret

to execute a program in a high-level language by translating it one line at a time

concatenate

to join two operands end to end

evaluate

to simplify an expression by performing the operations in order to yield a single value


Related study sets

h2 econs c6&7 - firms and decisions

View Set

Domain 5 - Healthcare Administration

View Set

Chapter 18 - Eating and Feeding Disorders MH EVOLVE

View Set

9C: Let's not jump to conclusions

View Set

MGA Exam 2: (Grays, BRS, Lab Quests,ect)

View Set

Chapter 12: Formation of Contracts; Offer and Acceptance

View Set

1. THE BEGINNINGS OF HUMAN SOCIETY

View Set