important definitions Flashcards
What is an algorithm?
- an ordered list of instructions - precise and unambiguous - eventually ends with a correct solution
What is a module?
A module is a reusable algorithm or group of functions. Having a bunch of functions saved into a .py document is considered a Module that you can import and use those pre built functions for other projects.
What does DDIT stand for?
Define, Design, Implement & Test

What is an IPO Chart?
An IPO chart helps organize our thinking so we don’t get confused (brainstorming). It consists of Input, Processing and Output.

What is Pseudocode?
Pseudo is an algorithm written to solve a problem that is written in a language which is less open to interpretation and English but is also less formal than a programming language.

What is a Flow Chart?
A flow chart is a visual representation of a algorithm design.

What is a Variable?
A variable is the part of a program that can “remember” values. They are boxes in memory that can hold 1 thing at a time.

What is an Expression?
An expression is any piece of code that provides a value.

What is a Statement?
The smallest complete action of a program, comparable to a sentence.

What is a Literal?
A literal is a value that is explicitly defined in your source code.

What is a Trace?
A trace is a table written with the history of all values of a specific algorithm. Like the results of a test.

What is String?
A string is a data type defined as a sequence of characters contained between a pair of quotation marks and can consists of letters, numbers and symbols.

What are Data Types?
Data Types are the different kinds of data we can work with, and include boolean values (true or false), integer numbers (numbers without decimals), real numbers (numbers with decimals), and strings (characters enclosed in quotes)

What are operators?
Operators are symbols that represent functions. eg. +, -, *.

What is String Concatenation?
A string concatenation uses the plus sign (+) to join strings together.

What is Precedence?
Precedence is commonly referred to as “order of operations” eg. bedmas

What is an Arithmetic Operator?
Operators that work with numbers.

What is the Integer Division Operator?
The Integer Division Operator is the whole number in an answer to long division.

What is the Modulo Operator?
The Modulo Operator is the remainder in an answer to long division.

What are Relational Operators?
Relational Operators compare two values to give a True or False statement.

What is a Boolean Operator?
The boolean operators are AND, OR, NOT.

What is the Precedence of Boolean Operators?
NOT, AND, OR - Highest to Lowest
What are String Operators?
Operators that are used to make changes to the string datatype.

What is the Precedence between operator groups?

What is an IF statement?
Simply a statement that states “IF this THEN that”.

What is an ELSE statement?
An else statement comes into play when the IF statement came back false then everything ELSE does THIS.

What is an ELIF statement?
An ELIF is used when there are multiple conditions before resulting in the ELSE Statement. An ELIF Statement is only run if the IF statement returns False, if you want every condition to be looked at every time than you will use multiple IF statements.

What is a WHILE Loop?
The While loop is a fundamental structure what repeats the loop while these conditions are met and only when these conditions are met.

What is a Sentinel Value?
Sentinel Values are values which cause the loop to exit and are often hinted at to the user in an input prompt.

What are Boolean Flags?
Boolean Flags are variable which hold the result of a more complicated expression and should be used to clarify code or to reduce calculations.

What is a FOR Loop?
The FOR Loop is especially useful for working with strings and lists by saying “FOR each character in the string, do something with it” etc.

What is a Function?
A Function is a reusable named section of a program that performs a specific task. In this sense, a function is a type of procedure or routine. There are built in Functions & user defined Functions.

What is Associativity?

What is a Parameter?
The variables that a function accepts are called parameters. In our example animalName and animalSound are parameters.

What is an Argument?
An argument is a specific value like “a cow” and “moo” and are substituted into the parameters.

What is Variable Scope?
Variable scope refers to being able to access a variable from a particular part of code.

What is a Method?
A method is a programmed procedure that is defined as part of a class and included in any object.

What is a range?
The difference of the beginning and ending character.

What does Consistent Data mean?

What is a program?
A program is a set of instructions.
What is a Bug?
A bug is an execution a program has processed where the program told the computer to do something it couldn’t.
What are Parentheses?
(Parentheses)
used to segregate expressions, placement for arguments for functions
What are Brackets?
[Brackets]
used to create strings, use methods like string slice
What are Braces or Curly Brackets?
{Braces}
What is an Assign statement?
x = 124654 (the = sign is assigning the number value to x)
What is a Syntax Error?
Syntax Errors happen when you type something that isn’t valid Python code.

What is a Semantic Error?
A Semantic Error happens when you tell Python to do something that it just can’t do, like divide a number y zero or try to use a variable that doesnt exist.

What does the help function do?
The Help Function shows documentation for any function.

What is a Memory Address?
Python keeps track of each value in a separate object and each object has a memory address. You can find the actual memory address of an object by using the built in function id:

What is a Function Definition?
A Function Definition tells Python what to do when that function is called.

What are Keywords?
Keywords are words that Python reserves for its own use. We can’t use them except as Python intends. Two of them are (def) and (return). If we try to use them as variables or functions Python produces an error.

What is a Function Header?
The function header is the first line of the function and starts with a “def”, followed by the name of the function, then a comma-separated list of parameters within parentheses, and then a colon.
What is a Local Variable?
Local variables get created each time that a function is called, and they are erased when the function returns. Because they only exist when the function is being executed, they can’t be used ourside of the function. Trying to access the local variable from outside the function is an error, the same error as never defining a variable in the first place.
What is a namespace?
A Space for Names
What is concatenation?

What is the repetition string operator?

What is a substring slice?

What is the membership string operator?

What does the tring method lower() do?
converts a string to lower case
what does the string method upper() do?
converts a string to upper case
what does the string method isalpha() do?
asks if the string is letters only?
what does the string method isdecimal() do?
checks if the string is all numbers
what does the string method islower() do?
checks if the string is all lowercase
what does the string method isspace() do?
checks if the string is spaces only
what does the string method isupper() do?
check if the string is all uppercase
what is data validation?

how to ranges work?

What is the ASCII table?
The ASCII table is a list of symbols in order of value from lowest to highest.

what does completion mean?

What does consistent data mean?

What are lists?

what is the index value in a list?

what is the data value in a list?

what is an element is a list?
a list item
what is the join list operator?

what is the repeat list operator?

what is the existance list operator?

whats is the slice list operator?

what is the len() function for lists?

what is the min() function in a list?

what is the max() function in a list?

what is the .reverse() method in a list?

what is the .sort() method for lists?

what is a boxframe?

what is a docstring?

what is the escape sequence?

What is a short-circuit evaluation?
When Python evaluates an expression containing and or or, it does so from left to right. As soon as it knows enough to stop evaluating, it stops, even if some operands haven’t been looked at yet. This is called short-circuit evaluation.
In an or expression, if the first operand is True, we know that the expression is True. Python knows this as well, so it doesn’t even evaluate the second operand. Similarly, in an and expression, if the first operand is False, we know that the expression is False. Python knows this as well, and the second operand isn’t evaluated.

What is the import function?
