Mostrar mensagens com a etiqueta Glossário Python. Mostrar todas as mensagens
Mostrar mensagens com a etiqueta Glossário Python. Mostrar todas as mensagens

terça-feira, 11 de agosto de 2015

?


Python

Bubble sort (wiki)

 

O bubble sort, ou ordenação por flutuação (literalmente "por bolha"), é um algoritmo de ordenação dos mais simples. A ideia é percorrer o vector diversas vezes, a cada passagem fazendo flutuar para o topo o maior elemento da sequência. Essa movimentação lembra a forma como as bolhas em um tanque de água procuram seu próprio nível, e disso vem o nome do algoritmo.

 

_______

sexta-feira, 24 de julho de 2015

Python

13. Glossary

pure function
A function that does not modify any of the objects it receives as arguments. Most pure functions are fruitful.
modifier
A function that changes one or more of the objects it receives as arguments. Most modifiers are fruitless.
functional programming style
A style of program design in which the majority of functions are pure.
prototype development
A way of developing programs starting with a prototype and gradually testing and improving it.
planned development
A way of developing programs that involves high-level insight into the problem and more planning than incremental development or prototype development.
algorithm
A set of instructions for solving a class of problems by a mechanical, unintelligent process.
.

14. Glossary

object-oriented language
A language that provides features, such as user-defined classes and inheritance, that facilitate object-oriented programming.
object-oriented programming
A style of programming in which data and the operations that manipulate it are organized into classes and methods.
method
A function that is defined inside a class definition and is invoked on instances of that class.
override
To replace a default. Examples include replacing a default value with a particular argument and replacing a default method by providing a new method with the same name.
initialization method
A special method that is invoked automatically when a new object is created and that initializes the object's attributes.
operator overloading
Extending built-in operators (+, -, *, >, <, etc.) so that they work with user-defined types.
dot product
An operation defined in linear algebra that multiplies two Points and yields a numeric value.
scalar multiplication
An operation defined in linear algebra that multiplies each of the coordinates of a Point by a numeric value.
polymorphic
A function that can operate on more than one type. If all the operations in a function can be applied to a type, then the function can be applied to a type.

15. Glossary

encode
To represent one set of values using another set of values by constructing a mapping between them.
class attribute
A variable that is defined inside a class definition but outside any method. Class attributes are accessible from any method in the class and are shared by all instances of the class.
accumulator
A variable used in a loop to accumulate a series of values, such as by concatenating them onto a string or adding them to a running sum.


16. Glossary

inheritance
The ability to define a new class that is a modified version of a previously defined class.
parent class
The class from which a child class inherits.
child class
A new class created by inheriting from an existing class; also called a "subclass."
 
 
.

quarta-feira, 22 de julho de 2015

Python

10. Glossary

dictionary
A collection of key-value pairs that maps from keys to values. The keys can be any immutable type, and the values can be any type.
key
A value that is used to look up an entry in a dictionary.
key-value pair
One of the items in a dictionary.
method
A kind of function that is called with a different syntax and invoked "on" an object.
invoke
To call a method.
hint
Temporary storage of a precomputed value to avoid redundant computation.
overflow
A numerical result that is too large to be represented in a numerical format.
.


11. Glossary

file
A named entity, usually stored on a hard drive, floppy disk, or CD-ROM, that contains a stream of characters.
directory
A named collection of files, also called a folder.
path
A sequence of directory names that specifies the exact location of a file.
text file
A file that contains printable characters organized into lines separated by newline characters.
break statement
A statement that causes the flow of execution to exit a loop.
continue statement
A statement that causes the current iteration of a loop to end. The flow of execution goes to the top of the loop, evaluates the condition, and proceeds accordingly.
format operator
The % operator takes a format string and a tuple of expressions and yields a string that includes the expressions, formatted according to the format string.
format string
A string that contains printable characters and format sequences that indicate how to format values.
format sequence
A sequence of characters beginning with % that indicates how to format a value.
pickle
To write a data value in a file along with its type information so that it can be reconstituted later.
exception
An error that occurs at runtime.
handle
To prevent an exception from terminating a program using the try and except statements.
raise
To signal an exception using the raise statement.

.

12. Glossary

class
A user-defined compound type. A class can also be thought of as a template for the objects that are instances of it.
instantiate
To create an instance of a class.
instance
An object that belongs to a class.
object
A compound data type that is often used to model a thing or concept in the real world.
constructor
A method used to create new objects.
attribute
One of the named data items that makes up an instance.
shallow equality
Equality of references, or two references that point to the same object.
deep equality
Equality of values, or two references that point to objects that have the same value.
shallow copy
To copy the contents of an object, including any references to embedded objects; implemented by the copy function in the copy module.
deep copy
To copy the contents of an object as well as any embedded objects, and any objects embedded in them, and so on; implemented by the deepcopy function in the copy module.
 
 
.
.

Python

9. Glossary

immutable type
A type in which the elements cannot be modified. Assignments to elements or slices of immutable types cause an error.
mutable type
A data type in which the elements can be modified. All mutable types are compound types. Lists and dictionaries are mutable data types; strings and tuples are not.
tuple
A sequence type that is similar to a list except that it is immutable. Tuples can be used wherever an immutable type is required, such as a key in a dictionary.
tuple assignment
An assignment to all of the elements in a tuple using a single assignment statement. Tuple assignment occurs in parallel rather than in sequence, making it useful for swapping values.
deterministic
A program that does the same thing each time it is called.
pseudorandom
A sequence of numbers that appear to be random but that are actually the result of a deterministic computation.
histogram
A list of integers in which each element counts the number of times something happens.
pattern matching
A program development plan that involves identifying a familiar computational pattern and copying the solution to a similar problem.
.

terça-feira, 21 de julho de 2015

Python

8. Glossary

list
A named collection of objects, where each object is identified by an index.
index
An integer variable or value that indicates an element of a list.
element
One of the values in a list (or other sequence). The bracket operator selects elements of a list.
sequence
Any of the data types that consist of an ordered set of elements, with each element identified by an index.
nested list
A list that is an element of another list.
list traversal
The sequential accessing of each element in a list.
object
A thing to which a variable can refer.
aliases
Multiple variables that contain references to the same object.
clone
To create a new object that has the same value as an existing object. Copying a reference to an object creates an alias but doesn't clone the object.
delimiter
A character or string used to indicate where a string should be split.
 
 
.

segunda-feira, 20 de julho de 2015

Python

7. Glossary

compound data type
A data type in which the values are made up of components, or elements, that are themselves values.
traverse
To iterate through the elements of a set, performing a similar operation on each.
index
A variable or value used to select a member of an ordered set, such as a character from a string.
slice
A part of a string specified by a range of indices.
mutable
A compound data types whose elements can be assigned new values.
counter
A variable used to count something, usually initialized to zero and then incremented.
increment
To increase the value of a variable by one.
decrement
To decrease the value of a variable by one.
whitespace
Any of the characters that move the cursor without printing visible characters. The constant string.whitespace contains all the whitespace characters.
.

Python

6. Glossary

multiple assignment
Making more than one assignment to the same variable during the execution of a program.
iteration
Repeated execution of a set of statements using either a recursive function call or a loop.
loop
A statement or group of statements that execute repeatedly until a terminating condition is satisfied.
infinite loop
A loop in which the terminating condition is never satisfied.
body
The statements inside a loop.
loop variable
A variable used as part of the terminating condition of a loop.
tab
A special character that causes the cursor to move to the next tab stop on the current line.
newline
A special character that causes the cursor to move to the beginning of the next line.
cursor
An invisible marker that keeps track of where the next character will be printed.
escape sequence
An escape character (\) followed by one or more printable characters used to designate a nonprintable character.
encapsulate
To divide a large complex program into components (like functions) and isolate the components from each other (by using local variables, for example).
generalize
To replace something unnecessarily specific (like a constant value) with something appropriately general (like a variable or parameter). Generalization makes code more versatile, more likely to be reused, and sometimes even easier to write.
development plan
A process for developing a program. In this chapter, we demonstrated a style of development based on developing code to do simple, specific things and then encapsulating and generalizing.
 
 
.

domingo, 19 de julho de 2015

Python


5. Glossary

fruitful function
A function that yields a return value.
return value
The value provided as the result of a function call.
temporary variable
A variable used to store an intermediate value in a complex calculation.
dead code
Part of a program that can never be executed, often because it appears after a return statement.
None
A special Python value returned by functions that have no return statement, or a return statement without an argument.
incremental development
A program development plan intended to avoid debugging by adding and testing only a small amount of code at a time.
scaffolding
Code that is used during program development but is not part of the final version.
guardian
A condition that checks for and handles circumstances that might cause an error.
 
 
.

Python


4. Glossary

modulus operator
An operator, denoted with a percent sign (%), that works on integers and yields the remainder when one number is divided by another.
boolean expression
An expression that is either true or false.
comparison operator
One of the operators that compares two values: ==, !=, >, <, >=, and <=.
logical operator
One of the operators that combines boolean expressions: and, or, and not.
conditional statement
A statement that controls the flow of execution depending on some condition.
condition
The boolean expression in a conditional statement that determines which branch is executed.
compound statement
A statement that consists of a header and a body. The header ends with a colon (:). The body is indented relative to the header.
block
A group of consecutive statements with the same indentation.
body
The block in a compound statement that follows the header.
nesting
One program structure within another, such as a conditional statement inside a branch of another conditional statement.
recursion
The process of calling the function that is currently executing.
base case
A branch of the conditional statement in a recursive function that does not result in a recursive call.
infinite recursion
A function that calls itself recursively without ever reaching the base case. Eventually, an infinite recursion causes a runtime error.
prompt
A visual cue that tells the user to input data.
.

Python

3. Glossary

function call
A statement that executes a function. It consists of the name of the function followed by a list of arguments enclosed in parentheses.
argument
A value provided to a function when the function is called. This value is assigned to the corresponding parameter in the function.
return value
The result of a function. If a function call is used as an expression, the return value is the value of the expression.
type conversion
An explicit statement that takes a value of one type and computes a corresponding value of another type.
type coercion
A type conversion that happens automatically according to Python's coercion rules.
module
A file that contains a collection of related functions and classes.
dot notation
The syntax for calling a function in another module, specifying the module name followed by a dot (period) and the function name.
function
A named sequence of statements that performs some useful operation. Functions may or may not take arguments and may or may not produce a result.
function definition
A statement that creates a new function, specifying its name, parameters, and the statements it executes.
flow of execution
The order in which statements are executed during a program run.
parameter
A name used inside a function to refer to the value passed as an argument.
local variable
A variable defined inside a function. A local variable can only be used inside its function.
stack diagram
A graphical representation of a stack of functions, their variables, and the values to which they refer.
frame
A box in a stack diagram that represents a function call. It contains the local variables and parameters of the function.
traceback
A list of the functions that are executing, printed when a runtime error occurs.
 
 
.

Python

2. Glossary

value
A number or string (or other thing to be named later) that can be stored in a variable or computed in an expression.
type
A set of values. The type of a value determines how it can be used in expressions. So far, the types you have seen are integers (type int), floating-point numbers (type float), and strings (type string).
floating-point
A format for representing numbers with fractional parts.
variable
A name that refers to a value.
statement
A section of code that represents a command or action. So far, the statements you have seen are assignments and print statements.
assignment
A statement that assigns a value to a variable.
state diagram
A graphical representation of a set of variables and the values to which they refer.
keyword
A reserved word that is used by the compiler to parse a program; you cannot use keywords like if, def, and while as variable names.
operator
A special symbol that represents a simple computation like addition, multiplication, or string concatenation.
operand
One of the values on which an operator operates.
expression
A combination of variables, operators, and values that represents a single result value.
evaluate
To simplify an expression by performing the operations in order to yield a single value.
integer division
An operation that divides one integer by another and yields an integer. Integer division yields only the whole number of times that the numerator is divisible by the denominator and discards any remainder.
rules of precedence
The set of rules governing the order in which expressions involving multiple operators and operands are evaluated.
concatenate
To join two operands end-to-end.
composition
The ability to combine simple expressions and statements into compound statements and expressions in order to represent complex computations concisely.
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.
.

Python

1. Glossary

problem solving
The process of formulating a problem, finding a solution, and expressing the solution.
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 language" or "assembly language."
portability
A property of a program that can run on more than one kind of computer.
interpret
To execute a program in a high-level language by translating it one line at a time.
compile
To translate a program written in a high-level language into a low-level language all at once, in preparation for later execution.
source code
A program in a high-level language before being compiled.
object code
The output of the compiler after it translates the program.
executable
Another name for object code that is ready to be executed.
script
A program stored in a file (usually one that will be interpreted).
program
A set of instructions that specifies a computation.
algorithm
A general process for solving a category of problems.
bug
An error in a program.
debugging
The process of finding and removing any of the three kinds of programming errors.
syntax
The structure of a program.
syntax error
An error in a program that makes it impossible to parse (and therefore impossible to interpret).
runtime error
An error that does not occur until the program has started to execute but that prevents the program from continuing.
exception
Another name for a runtime error.
semantic error
An error in a program that makes it do something other than what the programmer intended.
semantics
The meaning of a program.
natural language
Any one of the languages that people speak that evolved naturally.
formal language
Any one of the languages that people have designed for specific purposes, such as representing mathematical ideas or computer programs; all programming languages are formal languages.
token
One of the basic elements of the syntactic structure of a program, analogous to a word in a natural language.
parse
To examine a program and analyze the syntactic structure.
print statement
An instruction that causes the Python interpreter to display a value on the screen.


.