Python Crash Course
Python Crash Course Overview Study Notes:
Main Topics
Operators and Expressions
Lists, Tuples, Sets, and Dictionaries
Creating Functions in Python
Loops (while, for, break, continue)
Basic Structure of a Class
Strings, Numbers, and Boolean Values
Syntax, Syntax Types, Variables, and Data Types
Conditional Statements (if, elif, else)
Using Classes and Objects in Python
Operators and Expressions
Operators in Python include:
Arithmetic (e.g. +, -, *, /)
Comparison (e.g. ==, !=, <, >)
Logical (e.g. and, or, not)
Assignment (e.g. =, +=, -=)
Expressions are combinations of values, variables, and operators.
Lists, Tuples, Sets, and Dictionaries
Lists: ordered, mutable collections of items (e.g. my_list = [1, 2, 3])
Tuples: ordered, immutable collections of items (e.g. my_tuple = (1, 2, 3))
Sets: unordered, mutable collections of unique items (e.g. my_set = {1, 2, 3})
Dictionaries: unordered, mutable collections of key-value pairs (e.g. my_dict = {'key': 'value'})
Creating Functions in Python
Functions are defined using the def keyword and contain a block of code that can be executed by
calling the function. Functions can take in arguments, have return values, and can be defined
inside other functions (nested).
Loops (while, for, break, continue)
while loops execute a block of code while a certain condition is true
for loops iterate through a collection of items and execute a block of code for each item
break keyword exits a loop
continue keyword skips to the next iteration in a loop
Basic Structure of a Class
Classes are defined using the class keyword
Class attributes are defined inside the class definition
Class methods are defined inside the class definition and operate on the class attributes
Strings, Numbers, and Boolean Values
Strings are sequences of characters surrounded by quotes
Numbers include integers and floating point values
Boolean values are either True or False
Syntax, Syntax Types, Variables, and Data Types
Python syntax includes specific rules for writing code, such as indentation and the use of
keywords
Syntax types include expression syntax and statement syntax
Variables are placeholders for values, and their names follow specific conventions
Python Crash Course Overview Study Notes:
Main Topics
Operators and Expressions
Lists, Tuples, Sets, and Dictionaries
Creating Functions in Python
Loops (while, for, break, continue)
Basic Structure of a Class
Strings, Numbers, and Boolean Values
Syntax, Syntax Types, Variables, and Data Types
Conditional Statements (if, elif, else)
Using Classes and Objects in Python
Operators and Expressions
Operators in Python include:
Arithmetic (e.g. +, -, *, /)
Comparison (e.g. ==, !=, <, >)
Logical (e.g. and, or, not)
Assignment (e.g. =, +=, -=)
Expressions are combinations of values, variables, and operators.
Lists, Tuples, Sets, and Dictionaries
Lists: ordered, mutable collections of items (e.g. my_list = [1, 2, 3])
Tuples: ordered, immutable collections of items (e.g. my_tuple = (1, 2, 3))
Sets: unordered, mutable collections of unique items (e.g. my_set = {1, 2, 3})
Dictionaries: unordered, mutable collections of key-value pairs (e.g. my_dict = {'key': 'value'})
Creating Functions in Python
Functions are defined using the def keyword and contain a block of code that can be executed by
calling the function. Functions can take in arguments, have return values, and can be defined
inside other functions (nested).
Loops (while, for, break, continue)
while loops execute a block of code while a certain condition is true
for loops iterate through a collection of items and execute a block of code for each item
break keyword exits a loop
continue keyword skips to the next iteration in a loop
Basic Structure of a Class
Classes are defined using the class keyword
Class attributes are defined inside the class definition
Class methods are defined inside the class definition and operate on the class attributes
Strings, Numbers, and Boolean Values
Strings are sequences of characters surrounded by quotes
Numbers include integers and floating point values
Boolean values are either True or False
Syntax, Syntax Types, Variables, and Data Types
Python syntax includes specific rules for writing code, such as indentation and the use of
keywords
Syntax types include expression syntax and statement syntax
Variables are placeholders for values, and their names follow specific conventions