PC-Python
Introduction
- 1. Introduction
- 2. Using IDLE
- 2.1. Guide to Using the Python IDLE
- 2.2. The Interactive Shell
- 2.3. The Editor (Writing Scripts)
- 2.4. Key Features
- 2.5. Common Shortcuts
- 2.6. Using the Debugger
- 2.7. Accessing the Settings
- 2.8. Setting Font Face and Size
- 2.9. Key Configuration Options
- 2.10. Key Bindings (Shortcuts)
- 2.11. Saving Your Changes
Python
Python
- 1. Python Intro
- 2. Indentation
- 3. Python Data Types
- 4. Python Strings
- 5. Python Numbers
- 6. Python Booleans
- 7. Variables
- 8. Variables
- 9. Operators
- 10. Arithmetic operators
- 11. Compound_assignment
- 12. Comparison operations
- 13. Logical operations
- 14. Membership operations
- 15. Identity operators
- 16. Selection (If Statements)
- 17. Iteration (Loops)
- 18. Lists
- 19. Sets
- 20. Tuples
- 21. Dictionaries
- 22. Python Dictionary Methods
- 23. Bytes & Bytearrays
- 24. Multiple Assignment in Python
- 25. Python Unpacking Iterables
- 26. Python Functions
- 27. Function packing and unpacking
- 28. Python range() Function
- 29. f-strings
- 30. Python Classes & Objects
Python examples
- 1. Guess the number
- 2. Dictionary with functions
- 2.1. Dictionaries
- 2.2. Dictionary structure
- 2.3. Quiz: Dictionary Structure
- 2.4. Looking up dictionary values by key
- 2.5. Looking up dictionary values by the get method
- 2.6. Check if the key is in the dictionary
- 2.7. Quiz: Looking Up Values
- 2.8. Definition to get a dictionary value
- 2.9. Quiz: Rainbow Hex Colours
- 3. User additions to dictionary
- 4. Dictionary Question and Answer
Advanced Python
- 1. List Comprehensions
- 2. Dictionary Comprehensions
- 2.1. Dictionary comprehension
- 2.2. Dictionary comprehension of the range function, lists and strings
- 2.3. Dictionary comprehension of zipped lists
- 2.4. Conditions in a dictionary comprehension
- 2.5. Multiple conditions in a dictionary comprehension
- 2.6. Using a condition in a dictionary comprehension with zipped lists
- 2.7. Dictionary comprehension of dictionaries
- 2.8. Dictionary comprehension of dictionaries using if-else for value
- 2.9. Dictionary comprehension of dictionaries using a function for the value
- 2.10. Dictionary comprehension of dictionary of lists
- 2.11. Dictionary comprehension of dictionary of dictionaries of lists
- 2.12. Dictionary comprehension of a list of dictionaries
- 3. Set Comprehensions
- 4. Generators
- 5. Enumerate
- 6. Match - Case
- 6.1. Match-case
- 6.2. Case Alternatives
- 6.3. Wildcard
- 6.4. Variable instead of Wildcard
- 6.5. Splitting multi-word strings into a list for complex matching
- 6.6. Splitting with the use of as to capture the alternative used
- 6.7. Guard pattern: Combing a condition in a case
- 6.8. Using the unpacking operator on a list
- 6.9. Structure Matching lists or tuples
- 6.10. Matching tuples for coordinates
- 6.11. Matching sets
- 6.12. Matching dictionaries
- 6.13. Checking Types in Python Match-Case Statements
- 7. Validation
Files
- 1. Text files
- 2. csv files
- 2.1. Header rows
- 2.2. Opening files: newline=’’
- 2.3. csv.reader
- 2.4. Reading files
- 2.5. Reading files with non comma delimiter
- 2.6. next function
- 2.7. Using an index with the row lists
- 2.8. Padded strings
- 2.9. Reading a csv file to a list
- 2.10. csv writer
- 2.11. Converting comma delimited to tab delimited files.
- 2.12. Saving a list of sublists to a csv file
- 2.13. DictReader
- 2.14. DictReading files
- 2.15. Using a key with the row dictionaries
- 2.16. DictWriter
- 2.17. DictWriter.writeheader
- 2.18. DictWriter with fieldnames
- 2.19. DictWriter with selected fieldnames
- 3. json files
- 3.1. Structure
- 3.2. Loads
- 3.3. json to dict
- 3.4. Dumps
- 3.5. Printing specific keys from json objects
- 3.6. Printing specific keys from json objects with indenting
- 3.7. Convert a dict to json
- 3.8. Convert a nested dict to json
- 3.9. Convert a nested dict to json file
- 3.10. Load
- 3.11. Loading a json file
- 3.12. Printing specific keys
- 3.13. Dump
- 3.14. dump json data to a file
- 3.15. dump json processed file data to a file
- 4. json API
- 5. xml files
- 6. File conversions
Turtle
- 1. Introduction to turtle
- 2. Turtle screen
- 3. Turtle screen advanced
- 4. Turtle drawing
- 5. Turtle square progressions
- 6. Turtle rectangle progressions
- 7. Turtle star progressions
- 8. Turtle triangle progressions
- 9. Turtle dots
- 9.1. Turtle Dots
- 9.2. Draw_dot definition: dots at a specified location
- 9.3. Using the Draw_dot definition
- 9.4. draw_dot_stack definition
- 9.5. Exploring dot stacks further
- 9.6. Icecream cones from dot stacks
- 9.7. draw_dot_stack_cone definition
- 9.8. draw_dot_stack_cone usage
- 9.9. Hexagonal array: draw_dot_centre_hexagon definition
- 10. Turtle circles
- 11. Turtle regular polygons
- 12. Turtle pie slices
- 13. Turtle shapes module
- 14. Turtle houses module
- 15. Turtle houses designs
Classes
Class exercises