Section 1

Preview this deck

Hardcoded

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 14, 2020

Cards (159)

Section 1

(50 cards)

Hardcoded

Front

value cannot be changed once program has started

Back

terminating condition

Front

determines when a loop ends

Back

floating point divsions

Front

/

Back

integer division

Front

//

Back

scope

Front

visibiliy and lifespan of variables/functions

Back

Boolean expression

Front

evaluates to a boolean value

Back

conditionals statements control _________ of a program

Front

branching

Back

infix notation

Front

join operators and operands to make an expression

Back

not equal to

Front

!=

Back

variables defined in a function

Front

local scope, local variables

Back

algorithm

Front

take input perform computation generate output

Back

break

Front

exit body of a loop and resume program at end of loop body

Back

==

Front

compares value of expression on right to value on the left

Back

raise power

Front

**

Back

flow of execution/control flow

Front

how the program is read sequentially

Back

String

Front

A sequence of characters

Back

unary boolean

Front

not

Back

def

Front

define function with name and parameters

Back

logical expession

Front

individual boolean expressions are joined together by logical operators

Back

What is communicated through types

Front

intent

Back

binary boolean

Front

and or

Back

forms of control flow

Front

iteration branching

Back

infinite loop

Front

loop will never terminate

Back

less than or equal to

Front

<=

Back

readability

Front

variables should have meaningful names and comments w/ #

Back

Generalization

Front

promote code REUSIABILITY reduce size of code fundamental principle of programming

Back

function does this for statements

Front

encapsulates

Back

binary operator

Front

operator between 2 operands

Back

implementation error

Front

programmer failed to implement program correctly

Back

remainder/modulus

Front

%

Back

loop variable

Front

variable after "for"

Back

Name rules

Front

can't use python keyword can't have special characters must start with a letter or _ case sensitive

Back

Variable

Front

associate a name with a value

Back

index

Front

for loop variable

Back

Boolean value

Front

one of two possibilities, true or false

Back

unary operator

Front

like a negative sign

Back

call

Front

call upon a function

Back

accumulator

Front

variable that is reassigned repeatedly to itself combined w/ some mathematical operation

Back

grouping operators

Front

group with parentheses

Back

variable defined outside of function

Front

global variable and global scope

Back

return in def

Front

ends the function

Back

function/methods/procedures

Front

python commands

Back

difference between argument and parameter

Front

trivial

Back

continue

Front

loop skip rest of loop body and jump back to top of loop

Back

Less code produces

Front

reliability

Back

greater than or equal to

Front

>=

Back

string concatenation

Front

String + String NOT INT

Back

iteration

Front

repetition of same statement a number of times

Back

types

Front

string integer

Back

literal

Front

a way to write a value like string literal-"hello" or float literal- 3.14159

Back

Section 2

(50 cards)

array

Front

collection of lists kind of like tables in Excel w/ n dimensions

Back

for i in range

Front

Find if something is in array

Back

a = [1,3,4,7] for i in a: print(i)

Front

1 3 4 7

Back

scipy

Front

collection of modules like numpy and matplotlib

Back

Sequence type

Front

data structure specially designed to contain an ordered set

Back

collection

Front

Set

Back

empty string

Front

zero length string value rep w/ ""

Back

ord()

Front

ASCII to number

Back

a[x:y]

Front

x- rows y- column with first one being "0"

Back

numpy.zeros()

Front

array with zeros

Back

Library or package

Front

single module or collection of modules for python

Back

[x:y:z]

Front

start, stop, step

Back

Set

Front

pool of data that is used during computation

Back

indexing operators

Front

[ ]

Back

pandas

Front

python data analysis library- useful to read Excel

Back

a = [1,2,3,4] Slice 2 and 3

Front

b = a[1:3]

Back

len()

Front

number of characters in the string

Back

print( "hello"[4])

Front

o

Back

matplotlib

Front

plotting module allow data to be visualized

Back

default value

Front

specified by assigning a value to parameter in function declaration

Back

print(a.shape)

Front

print the # of fields, # of columns

Back

immutable

Front

unchangable

Back

"hello" * 2

Front

hellohello

Back

what class is t =(1,2,3)

Front

tuple

Back

module

Front

file or set of files that contain Python definitions and statements intended for use in other Python programs`

Back

primitive types

Front

int, float, bool

Back

np.reshape()

Front

copy b to a

Back

len("hello world")

Front

11

Back

chr()

Front

convert number to ASCII

Back

numpy.ndarray()

Front

make a (n) array

Back

Mutability

Front

whether data inside a variable can change once an intital value has been assigned

Back

a = [1,3,4,7] Reverse this order

Front

b= a[::-1]

Back

a = [1,2] Add 3 and 4 to the list

Front

b = a + [3,4] OR a.append(3) a.append(4)

Back

map ice tea to lemonade in a dictionary what happens when print(d['ice tea'])

Front

d = {'ice tea':'lemonade'} lemonade

Back

make empty dictionary called d

Front

d = {}

Back

a = [1,3,4,7] Change a 4 to a 10

Front

a[2] = 10

Back

Sequence

Front

ordered set

Back

in

Front

boolean expression see if in list

Back

Map

Front

special type of collection in dictionary

Back

ASCII

Front

American Standard Code for Information Interchange

Back

numpy

Front

data manipulation

Back

a = [1,3,4,7] print(4 not in a)

Front

True

Back

a = [1,2,3,4] Slice 3 and 4

Front

b = a[2:]

Back

import module as something else for numpy

Front

numpy as np

Back

a = [1,2,3,4] Slice 1 and 2

Front

b = a[:2]

Back

print("world"[-2])

Front

l

Back

a = [1,3,4,7] print(4 in a)

Front

True

Back

dictionary

Front

collection and it is a sequence type

Back

list

Front

sequential collection of data values

Back

print('Hello World'[0:5:1])

Front

Hello

Back

Section 3

(50 cards)

Do all logical operators have the same precedence

Front

No

Back

show a plot

Front

plt.show()

Back

linestyle of alternating dash dot

Front

-.

Back

Can a function parameter share a name with a variable outside of the function

Front

Yes

Back

label x axis, yaxis and give title

Front

plt.xlabel('xaxis') plt.ylabel('yaxis') plt.title('title')

Back

Add 1 to each number in a= [1, 2, 3]

Front

b = a+ 1

Back

make histogram

Front

plt. hist(s)

Back

find standard deviation

Front

np.std()

Back

plot line to 10 not inclusive

Front

x= np.arange(10) y= x*2 plt.plot(x,y)

Back

save a plot picture w/ 200 dpi

Front

plt.savefig('test.png', dpi=200)

Back

a= [[1 2] slice 1st column

Front

a[:,0]

Back

slicing [a:b, c:d]

Front

row - start a stop b column start c stop d

Back

large square marker

Front

s

Back

a= [[2,3 [3,3 ]] find shape of array

Front

a.shape (2,2)

Back

color for black

Front

k

Back

find the mean of A

Front

A.mean()

Back

plot a sin function

Front

x = np.arange(0, 2*math.pi, 0.1) y = np.sin(x) plt.plot(x,y)

Back

large circle marker

Front

o

Back

put a sin and cosin in 2 graphs next to each other

Front

x = np.arange(0, 2*math.pi, 0.1) s = np.sin(x) c = np.cos(x) fig, (ax1, ax2) = plt.subplots(2,1) ax1.plot(x,s) ax2.plot(x,c)

Back

large triangle marker

Front

^

Back

flip the matrix along diagonal

Front

a.transpose() or a.T

Back

classes of operators from highest to lowest precedence

Front

Grouping, Math, Logical, Comparison

Back

save the file as text file

Front

np.savetxt('filename.txt')

Back

load a file named data.txt

Front

a = np.loadtxt('data.txt')

Back

do variables have parameters

Front

No

Back

scatter plot w/ scatter

Front

plt.scatter(x,y)

Back

A =[[0 1 2] [3 4 5] [6 7 8]] Find median of first row

Front

A[0,:].median()

Back

np.arange(3.,7.,2.)

Front

[ 3. 5. ]

Back

list vs array

Front

[ 1, 2, 3, 4,] [1 2 3 4]

Back

a= [[1 2] [3 4]] slice 2nd row

Front

a[1,:]

Back

max and min of a

Front

a.max(), a.min()

Back

code to roll a dice

Front

import random roll = random.randrange(1,6)

Back

linestyle of dotted line

Front

:

Back

linestyle of solid line

Front

-

Back

a= np.arange(27) a.reshape(3,3,3)

Front

[[[ 0 1 2] [ 3 4 5] [ 6 7 8]] [[ 9 10 11] [12 13 14] [15 16 17]] [[18 19 20] [21 22 23] [24 25 26]]]

Back

[[1,2,3], [4,5,6], [7,8,9]] slice 4 5 7 8

Front

[1:, :2]

Back

large diamond marker

Front

D

Back

plot cosine function

Front

x = np.arange(0, 2*math.pi) y = np.cos(x) plt.plot(x,y)

Back

Are expressions always processed from left to right

Front

No

Back

A =[[0 1 2] [3 4 5] [6 7 8]] find mean of last column

Front

A[:,2].mean()

Back

change l list to an array

Front

np.array(l)

Back

give a line x, green, linewidth of 8, linesytle of dotted line, w. small circles

Front

plt.plot(x, color='r', linewidth=8, linestyle= ':', marker='.')

Back

Compute the difference between two samples

Front

np.diff()

Back

=

Front

assigns value of theexpression on the right of the operator to the variable on the left

Back

linestyle of dashed line

Front

_

Back

scatter plot with line

Front

plt.plot(x, y, marker= 'o', linewidth=0)

Back

make an interval to including 7

Front

np.arange(8)

Back

make an array with 7 zeros

Front

import numpy as np a = np.zeros(7)

Back

a = np.array([[1,2],[3,4]]) index 2nd list and 2nd term

Front

a[1,1] 4

Back

make an array of zeros that is a 2 by 3

Front

np.zeros(2,3)

Back

Section 4

(9 cards)

float

Front

real numbers with decimals

Back

Can a control structure appear inside the body of another control structure

Front

No

Back

output of range(5)

Front

0,1,2,3,4

Back

can a function return a value of any type

Front

Yes

Back

can variable and function names share a name w/ reserved word

Front

No

Back

output of range(2,10,2)

Front

2,4,6,8

Back

int

Front

Real numbers without decimals

Back

False if all conditions are true: x is non-negative and y is outside interval [-1,1]

Front

Not(x>=0 and (y<-1 or y>1))

Back

what type of structure is if, elif, and else associated with

Front

conditional branches

Back