Use LEFT and RIGHT arrow keys to navigate between flashcards;
Use UP and DOWN arrow keys to flip the card;
H to show hint;
A reads text to speech;
30 Cards in this Set
- Front
- Back
Global variable |
Variables that are declared outside any function, and they can be accessed (used) on any function in the program. |
|
Local Variable |
Variables are declared inside a function, and can be used only inside that function. It is possible to have local variables with the same name in different functions. |
|
Object Orientated Programming |
Is a programming language model organized around objects rather than "actions" and data rather than logic. *Historically, a program has been viewed as a logical procedure that takes input data, processes it, and produces output data. |
|
Shell |
Is a program that lets you type instructions into the computer, much like the terminal or command prompt. |
|
Python Interactive Shell |
Lets you enter instructions for the python interpreter software to run. The computer reads the instructions you enter and runs them immediately. |
|
Expression |
Consists of values (such as 2) and operators (such as +) that evaluate (reduce) down to a single line. *Evaluates to a single value. Ex: >>> 2 + 2 4 >>> |
|
Operators that can be used in Python |
** : Exponentiation %: Modulus/remainder //: Integer division/floored quotient /: Division *: Multiplication (can only be used with 2 numeric values or for string replication.) -: Subtraction +: Addition |
|
Prescedence |
Order of operations of Python math operators. (PEMDAS) ** operator is evaluated first; the *, /, // and % operators next, and the + and - operators are evaluated last. (From left to right) |
|
Data type |
A category for values, and every value belongs to exactly one _____ type. |
|
Common data types in Python |
-Integers (-2, -1, 0, 1 , 2, 3) -Floating-point numbers (-1.25, -1.0, -0.5, 0 , 0.5,) -Strings ("a", "aa", "Hello") |
|
Integer (int) Values |
Data type that indicates values that are whole numbers. *Helpful if you have a number as a string value that you want to use in some math. |
|
Floating-point (float) Values |
Data type that indicates values with a decimal point. |
|
String (str) Values |
Data type that indicate values with character surrounded by quotes. (' ', " ") |
|
Blank string |
A string with no characters in it. (' ') |
|
String Concatenation |
When + operator is used to join two string values and combines them together. |
|
String Replication operator |
* operator used on one string and integer value to replicate/repeat the original number of times equal to the integer value. Ex: 'Alice' * 5 AliceAliceAliceAliceAlice |
|
Variable |
Is like a box in the computer's memory where you can store a single value. *If you want to use the result of an evaluated expression later in you program, you can save it inside a variable. |
|
Assignment Statement |
Where you store values in variables. Consists of a variable name, an assignment operator (=) and the value stored. Ex: spam= 42 |
|
Overwritting |
When a variable is assigned a new value, the old one is forgotten. (Variable reassignment??) |
|
Variable Names |
3 Rules: 1. Can only be one word 2. Can only use letters, numbers and the underscore characters. 3. Cannot begin with a number. * They are case-sensitive and best describes the data it contains. |
|
File editor |
Where you type your code. Similar to text editors like Notepad or TextMate. Has some specific features for typing in source code. |
|
Interactive shell vs. File Editor |
-Interactive shell window will always be the one with the (>>>) prompt. - The file editor will not |
|
# |
Used to write notes or single lined comments to remind yourself what the code is trying to do. *Commenting out is when programmers use # character in front of a line of code to temporarily remove it while testing the program to see what works and what doesn't. Then removing the # once they are all set testing. |
|
print() |
Function that displays the string value inside the parenthesis on the screen. |
|
Arguement |
Is a value that is is passed to a function. |
|
input() |
Function waits for user to type in some text on the keyboard and press enter. This function call evaluates to a string equal to the user's text, and then assigns the string value to a variable. Always return a string |
|
len() |
Function evaluates to the integer value of the number of characters in that string. * You can pass this function a string value (or a variable containing a string.) |
|
str() |
Function that can be passed an integer value and will evaluate to a string value version of it. *Is handy when you have an integer or float that you want to concatenate to a string. |
|
Difference between expression and assignment statement |
One evaluates down to a single line, opposed to having a value stored into a variable. |
|
round() |
Function that returns number rounded to the number digits position after the decimal point. EX: >>> round(32.45) 32 >>> |