Lecture Name: Print, Calculator, Variable Types and Operators
\n",
" \n",
"
File Name: Week 01 F.ipynb
\n",
" \n",
"
Class Date: 09/29/2023
\n",
"\n",
"Key Points:\n",
"\n",
"
\n",
"
An integer variable is a number with no decimal point\n",
"
A floating point variable is a number with a decimal point\n",
"
A string variable is text\n",
"
A Boolean variable can take on the values True and False\n",
"
A NoneTypevariable can take on the value None\n",
"
Python uses dynamic typing, which means you don't need to define a variable's type when you first use that variable\n",
"
The type() command lets you see what type a given variable is. int(), float(), and str() can be used to convert to different variable types\n",
"
Combining a float and an integer results in a float\n",
"
Combining a string and an integer or float results in a TypeError\n",
"
Floats are often prone to rounding errors\n",
"
and and or can be used to combine Boolean variables"
]
},
{
"cell_type": "markdown",
"id": "c8dcb344-0708-4ba9-9ccb-df22e34edea2",
"metadata": {},
"source": [
"
Lecture Name: Lists and Dictionaries
\n",
" \n",
"
File Name: Week 02 M.ipynb
\n",
" \n",
"
Class Date: 10/02/2023
\n",
"\n",
"Key Points:\n",
"\n",
"
\n",
"
A list is a mutable, ordered sequence of elements\n",
"
Python counts starting with 0, not 1\n",
"
You can also count backwards from the end of a list using negative numbers\n",
"
A list can be sliced, where the slice is defined by a range that has an inclusive lower bound and an exclusive upper bound\n",
"
Values in a list can be changed by assignment or by particular methods\n",
"
A tuple is an immutable, ordered sequence of elements\n",
"
A dictionary is a mutable, unordered sequence of elements consisting of key:value pairs"
]
},
{
"cell_type": "markdown",
"id": "0af5f1b7-48e9-4131-a331-5e35826a677a",
"metadata": {},
"source": [
"
Lecture Name: Functions and Logic
\n",
" \n",
"
File Name: Week 02 W.ipynb
\n",
" \n",
"
Class Date: 10/04/2023
\n",
"\n",
"Key Points:\n",
"\n",
"
\n",
"
A function is a block of code that can be called\n",
"
Functions can be called using either positional or keyword arguments\n",
"
Positional arguments can be described via lists and keyword arguments can be desribed via dictionaries\n",
"
Python uses if statements for logical constructs\n",
"
The code within an if statement is run if the current statement is true\n",
"
The code within an elif statement applies if prior statements are not true and the current statement is true\n",
"
The code within an else statement applies if all prior statements are not true"
]
},
{
"cell_type": "markdown",
"id": "44c499c2-bab1-48be-8edc-c6c59a23659f",
"metadata": {},
"source": [
"
Lecture Name: Loops
\n",
" \n",
"
File Name: Week 02 F.ipynb
\n",
" \n",
"
Class Date: 10/06/2023
\n",
"\n",
"Key Points:\n",
"\n",
"
\n",
"
A for loop lets you repeat an operation a specified number of times\n",
"
Indentation is critical for lists in Python\n",
"
The range() function will create a list of all values up to (but not including) the specified integer\n",
"
Hardcoding is the act of restricting a piece of code so it only works under specific circumstances (generally want to avoid this)\n",
"
A while loop lets you repeat an operation until a particular condition is met\n",
"
The index in a while loop must be initialized and care should be taken to avoid infinite loops"
]
},
{
"cell_type": "markdown",
"id": "7a2a73cf-6155-42d8-b792-7144f1821844",
"metadata": {},
"source": [
"
Lecture Name: Modules and Exception Handling
\n",
" \n",
"
File Name: Week 03 M.ipynb
\n",
" \n",
"
Class Date: 10/09/2023
\n",
"\n",
"Key Points:\n",
"\n",
"
\n",
"
A module is a library of Python source code that gives access to new variables and functions\n",
"
Modules can be imported as whatever name you like\n",
"
A raise statement lets you define your own error conditions and stop code when they're met\n",
"
A try/except block will let you fix common issues that would otherwise result in exceptions"
]
},
{
"cell_type": "markdown",
"id": "1972b16e-0c87-482b-8e05-dd4c99b3c11c",
"metadata": {},
"source": [
"
Lecture Name: Arrays
\n",
" \n",
"
File Name: Week 02 W.ipynb
\n",
" \n",
"
Class Date: 10/11/2023
\n",
"\n",
"Key Points:\n",
"\n",
"
\n",
"
An array is NumPy's version of a list, which allows you to work with matrices\n",
"
All elements of an array are of the same type\n",
"
You can either create a new array or convert an existing list into one\n",
"
The zeros() function is useful for initializing an array when you know the shape and size but not the contents\n",
"
The arange() function serves a similar purpose to the range() function with lists\n",
"
Similar to lists, arrays can be sliced, but arrays can also be sliced across each of their dimensions"
]
},
{
"cell_type": "markdown",
"id": "31e2ef42-a0ec-468a-8c53-189b314186ee",
"metadata": {},
"source": [
"
Lecture Name: Testing Inside Arrays
\n",
" \n",
"
File Name: Week 03 F.ipynb
\n",
" \n",
"
Class Date: 10/13/2023
\n",
"\n",
"Key Points:\n",
"\n",
"
\n",
"
You can use functions within NumPy to find the shape, number of dimensions, and number of elements in any array\n",
"
numpy.where() will let you find the locations of elements within an array that meet a specified criterion\n",
"
Some functions within NumPy allow you to manipulate arrays, such as reshaping, transpoing, unraveling, concatenation, and repeating individual array elements\n",
"
When you're in a situation with multiple nested loops, often you can instead perform all operations a lot more easily by using array syntax\n",
"
Mathematical operations act on arrays elementwise\n",
"
When testing within an array, and and or cannot be used; instead, use NumPy's built-in functions"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4d9362ec-b4ad-421d-8e13-74527bc19ede",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.4"
}
},
"nbformat": 4,
"nbformat_minor": 5
}