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;
57 Cards in this Set
- Front
- Back
Feature of text editor which indicates text that is not part of the Python code |
Syntax highlighting |
|
Program responsible for reading a Python program and telling the computer what it means |
Python interpreter |
|
Information associated with a variable |
Value |
|
5 variable rules in python |
1) Only letters, numbers, and underscores; cannot start with a number 2) No spaces 3) Avoid using Python keywords & function names 4) Keep variable names short but descriptive 5) Avoid confusing l and 1 or O and 0 |
|
A series of characters |
string |
|
Method for displaying words in title case |
title () |
|
Method for converting string to all lowercase (good fit storing data) |
lower () |
|
Character used to tell Python to apply a method to a variable |
Dot (.) |
|
Character used to combine strings |
Plus sign (+) |
|
Combining strings |
concatenation |
|
Built-in function which displays something on the screen |
print () |
|
A non-printing character |
whitespace |
|
TAB character combination |
\t |
|
Newline character combination |
\n |
|
Method for removing whitespace to the right of a string |
rstrip () |
|
Method for stepping whitespace to the left of a string |
lstrip() |
|
Method for removing whitespace from the right and left of a string |
strip () |
|
Happens when Python doesn't recognize a section of program as valid Python code |
Syntax error |
|
Numbers with a decimal point |
float |
|
When Python can't recognize the kind of information you're using |
type error |
|
Built-in function you can use to avoid a type error when using an integer in a string |
str() |
|
Character used to indicate a comment line |
Pound (#) |
|
3 built-in function specifically for finding numbers in a list |
1) min() 2) max() 3) sum() |
|
Combines for loop and the creation of new elements into one line, appending each new element |
List comprehension |
|
What Python calls a group of elements in a list |
slice |
|
Values that cannot change |
immutable |
|
An immutable list |
tuple |
|
A collection of items in a particular order |
list |
|
Best practice for naming lists |
Make the name plural |
|
Position of an item in a list |
index |
|
First position in a list |
0 |
|
Index of last item in a list |
-1 |
|
List where elements are added or removed as the program runs |
Dynamic list |
|
Method used to add an element to the end of a list |
append() |
|
Method used to add an element to any position in a list |
insert () |
|
Statement used to remove an item from a list |
del |
|
Method used to remove an item from a list while allowing you to work with it afterward |
pop() |
|
Default index in list removed by pop() |
-1 |
|
Method used to remove the first occurrence of a value from a list when you don't know the position |
remove() |
|
Method used to permanently reorganise the order of a list alphabetically |
sort() |
|
Method and argument used to sort list in reverse alphabetical order |
sort(reverse=True) |
|
Method to sort a list without affecting the original order |
sorted() |
|
Method used to permanantly reverse the order of the original list |
reverse () |
|
Function used to find the length of a list (starts count with 1) |
len() |
|
Syntax which defines what runs in a for loop |
Indentation |
|
An error where the syntax is correct but the results are not what are desired |
logical error |
|
Method used to generate a series of numbers (1=0 and it never prints the second value) |
range () |
|
Method for creating a list of numbers |
list(range(1,5)) |
|
Operator designating exponents |
** |
|
3 functions specific to lists of numbers |
1) min() 2) max() 3) sum() |
|
Combines the for loop and the creation of new elements into one line, automatically appending each new element |
list comprehension |
|
Expression that can be evaluated as TRUE or FALSE |
conditional test |
|
Equality operator |
double equal sign: |
|
Returns True if the value on the left and right side of the operator match; False if they don't |
equality operator |
|
True or False: |
True |
|
Not equal |
Exclamation and equal signs: != |
|
Another name for a conditional test |
boolean expression |