Ch. 1 + 5 (functions) vocabulary Flashcards
Program
A set of instructions the computer follows to perform a task.
Programmer
Person who can design, test and create computer programs.
Hardware
The physical components that make up a computer.
Central Processing Unit (CPU)
The part of the computer that actually runs the programs. The most important component of the computer.
Microprocessors
CPUs located on small chips.
Main memory (RAM)
Stands for Random Access Memory. Where a computer stores a program while it’s running, along with data used by the program.
Secondary storage
Can store data for long periods of time, even when the computer is off. For example, disc drive, solid state drive, flash drives, etc.
Input
Data the computer collects from people and other devices.
Input device
Component that collects data.
Output
Data produced by the computer for other people or devices.
Output device
Device used to format and present output.
Application software
Programs that make the computer useful for everyday tasks
System software
Programs that control and manage basic operations of the computer.
Byte
Just enough memory to store a small number or a letter. Consists of 8 bits.
Bit
Stands for binary digit. The smallest piece of information that can be stored.
Digital
Describes any device that stores data as binary numbers.
Assembly language
Language made up of mnemonics that is close in nature to machine language. Requires a good understanding of how the CPU works.
Algorithm
A set of well-defined logical steps that must be taken to perform a certain task.
Pseudocode
Fake code.
Flowchart
Diagram that graphically depicts the steps in a program.
Function
Piece of prewritten code that performs a task.
print function
Displays output on the screen.
argument
Data given to a function.
String
A sequence of characters that is used as data.
String literal
String that appears in the actual code of the program.
Comments
Notes of explanations within a program.
End-line comment
Appears at the end of a line of code.
Variable
Name that represents a value stored in the computer memory.
Assignment statement
Used to create a variable and make it reference data.
Garbage collection
Removal of values that are no longer referenced by variables.
Data types
Categorized values in computer memory.
Numeric literal
Number written in a program.
Exponent operator **
Raises a number to a power.
Multiline continuation character \
Allows to break a statement into multiple lines.
Expression
An instruction that combines values and operators and always evaluates down to a single value.
format()
The format function always returns a string value. Can be used to format the number, by expressing the number of decimal points, comma separators, etc.
Name 5 built-in functions
print(), int(), float(), format(), input(), abs(), max(), min(), round(), str(), len(), type()
abs(n)
Returns the absolute value of a function (always a positive number). The value is the same as the parameter n. The data type of the number is the same as the data type of the parameter.
round(n)
Returns the integer value closest to the number n. When ‘round’ is used with one argument, as shown, the data type returned is int and the value is the closest integer value to n.
round(n,d)
When used with two arguments, round(n,d) returns n rounded to d digits after the decimal points. The data type of the value returned is the same as the data type of n.
len(s)
Returns the number of elements in the sequence s. A string is a sequence of characters, so len(s) can be used to find the number of characters in a string.
type(x)
Returns the data type of object x.
min(…)
Returns the minimum value among all those provided as arguments. The arguments may be two or more individual numbers (i.e. two or more expressions that evaluate to a numerical type). Alternately, a single “iterable” object (e.g. a list) may be provided as an argument.
max(…)
Returns the maximum value among all those provide as arguments. The arguments may be two or more individual numbers (i.e., two or more expressions that evaluate to a numerical type). Alternately, a single “iterable” object (e.g. a list) may be provided as an argument.
Software
Software are computer programs that make the computer useful.
Compiler
A program that translates a high-level programming language into a separate machine language.
Interpreter
A program that translates a high-level programming language into machine language and then executes it.
List the steps in the software development cycle.
- Analyze. Define the problem and make sure it’s fully understood. Determine required inputs and outputs.
- Design a solution to the problem, i.e. an algorithm.
- Code. I.e. translate your design into the Python language. This step includes creating an effective user interface that obtains the required input from the user and presents output back.
- Test and debug to correct syntax and logic errors. How can you prove to yourself that the program works for all expected and unexpected inputs?
- Document. Documentation includes everything that describe the program, its purpose and how it operates. Full documentation is an important piece of every programming project.