Everything Flashcards
(36 cards)
What is a central processing unit
cpu.it performs computation
Declarative knowledge
Facts and feelings we just know. know that
Imperative knowledge
Knowledge we used when we do something.know-how
Algorithm
They are imperative, rely on inputs, step bystep procedure with decisions
Software
Description of instructions for a computer
Expression
A combination of values and operators that evaluates to a single result
Literals: floats, integers, strings and Boolean
_ Literals literally mean what say. Integers exam\ple: (1,2,3) float example (3.0,4.2 and real numbers string is text and bodlean is true false
Variable
Named value, does not have a type! Value does. R must start with letter or underscore. Only contain letters or numbers or underscores and no keyword
Arithemetic operators
Operants and results are numeric example (//int div)
Companion operators
Operants are numerical results are Boolean like ><
Logical operators
Operants and results are Boolean for example and,or, not,^(xor)aka one is true
Syntax
In natural languages, syndaxis synonymous with grammar. In programming it is synonymous with rules are strict
Python script
Sequence python statements an comments saved in plain text.
Proposition
In programming, it Is a declarative statement that is either true or false
Flow chart
Visual representation of procedure. Boxes are activities. Diamonds are decisions
Iteration
The repetition of asequence of computer instructions a specified number of times (def) or until a condition is met (ind)
Indefinite loops
Useful for when we want to keep executing a statement until true, when we want to execute forever. It is a while loop. WHILE TRUE AND USE BREAK TO ESCAPE.
Definite iterations
For loop. Repetition of set instructions a number of times.
String iterations
Len() returns length. Character is unit of info related to an alphabetic letters. Ord() to get numerical value of letter. ().isupper or ().islower to check if upper or lower.
Range function
Starts at 0 number up until, number before last number
Lists
Collection of values, ordered sequentially, can be diff types. []. each item in list is an element, start at 0. Can append. Insert, remove and reverse
Slicing
Like a range, specified increments. [0:4] be 0,1,2,3 or [0:4:2] be 0,2
Function
Have a name,zero or more inputs/outputs. Key for organization, resuability, decomposition etc. def keyword(parameters). Have return value
Parameters
Variables initialized by arguments, not the actual value itself