Exam 1 Flashcards
What is a “program”
An algorithm to accomplish a task
What is an “IDE”
Integrated Development Environment:
A compiler like spyder
Quality assurance
how someting is checked to make sure it works as it is supposed to
what is a unit test?
Software test that focuses on components of a program
What is a test suite and a test runner
collection of test cases to run a single job with different test scenarios
Test runner: tool that is used to run tests and export results
t or f:
false, it should contain only one assertion statement
what is TDD
test driven development:
development where software requirements are converted tot est cases before software is fully developed
what is pseudocode, why helpful
pseudocode is informal way of programming that does not require strict language syntax
can be helpful cuz more understandable
What is a module, why helpful
a file that defines a collection of useful functions and variables, usually have a common theme or purpose
helpful so no need to redefine functions or variables every time
what is a statement in a program
a command in a program that a computer understands
what is an expression
value or anything that executes and becomes a value
what are the rules for a valid variable name
1) start with a letter or underscore
2) only made of letters numbers or underscores
3) capitalized letters matter
is a==A
no
why is x = x**2 always valid
the expression updates x
what is an operand
term used to describe the data or values that are operated on by an operater
name three types and describe each of them
1) numeric (int, float, complex)
2) text sequence (string) words
3) sequence: list and range
4) binary sequence
5) plot: graphical representation of numeric data
etc…….
binary operator?
operators that require two operands at least eg +, -, *
unary operator?
operators that require one operand
only needs one operand: negative or positive
what does = do?
assigns a value to a variable
what does == do
compares two values to determine if they’re equal
what does % do
output is the remainder
waht does // do
divides and returns only integer result
eg -8//3 is -3 because answer is -2.67777… so rounds up
what will -8/3 calculate to
-3
what will 8%-3 calculate to
will be -3 because because will return a value that is the same sign as the denominator
goes in opp direction
3 * 3 = 9 so remainder is -1
3*2 = 6 so remainder is +2