Everything Flashcards

(36 cards)

1
Q

What is a central processing unit

A

cpu.it performs computation

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Declarative knowledge

A

Facts and feelings we just know. know that

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Imperative knowledge

A

Knowledge we used when we do something.know-how

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Algorithm

A

They are imperative, rely on inputs, step bystep procedure with decisions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Software

A

Description of instructions for a computer

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Expression

A

A combination of values and operators that evaluates to a single result

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Literals: floats, integers, strings and Boolean

A

_ 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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Variable

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Arithemetic operators

A

Operants and results are numeric example (//int div)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Companion operators

A

Operants are numerical results are Boolean like ><

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Logical operators

A

Operants and results are Boolean for example and,or, not,^(xor)aka one is true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Syntax

A

In natural languages, syndaxis synonymous with grammar. In programming it is synonymous with rules are strict

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Python script

A

Sequence python statements an comments saved in plain text.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Proposition

A

In programming, it Is a declarative statement that is either true or false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Flow chart

A

Visual representation of procedure. Boxes are activities. Diamonds are decisions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Iteration

A

The repetition of asequence of computer instructions a specified number of times (def) or until a condition is met (ind)

17
Q

Indefinite loops

A

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.

18
Q

Definite iterations

A

For loop. Repetition of set instructions a number of times.

19
Q

String iterations

A

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.

20
Q

Range function

A

Starts at 0 number up until, number before last number

21
Q

Lists

A

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

22
Q

Slicing

A

Like a range, specified increments. [0:4] be 0,1,2,3 or [0:4:2] be 0,2

23
Q

Function

A

Have a name,zero or more inputs/outputs. Key for organization, resuability, decomposition etc. def keyword(parameters). Have return value

24
Q

Parameters

A

Variables initialized by arguments, not the actual value itself

25
Arguments
Values passed into functions, the value itself
26
Function dockstring
Description of a function like a comment, triple quoted
27
Function body
One or more statements, can be pass
28
Return value
Functions output,can be any value and can be none
29
Local variables
Variables defined within a function. Created when function is called and deleted when function is done
30
Global variables
Variables defined in script level. An access using keyword global aka global x
31
Recursion
A function calling itself, beware of infinite recursion and needs a base case to know when to stop recusing
32
Modules
Easier to construct a program, reuse functions. From x import y. From x import*. Import x . Dir() function tells us names in a module
33
Tuple
Immutable. Created with parenthesis. Iterable. Storing simple sequence, returning multiple things from a function. Like lists
34
Sets
Collection of values or objects, unordered, values cannot be duplicated.
35
Set method
UNION. set1.union(set2) to get all of unique values INTERSECTION. set1.intersection(set2) to get the intersection like in each one DIFFERENCE. set1-set2 subtracts second set from first one
36
Dictionary
With curly braces. Mutable. values accessed via get() or via key in square brackets {okay:slay,etc}. To get a certain index do class[studnet] and will print the info or set equal to something to change