Skip to content

ccozad/python-playground

Repository files navigation

GitHub code size in bytes GitHub top language GitHub Run Python Tests

Overview

A collection of random Python solutions. If anything helps you here please give this repo a star.

See commentary and other material on the Think Create Repeat YouTube Channel

General Setup

It's recommended that you use a virtual environment to run each group of scripts. Each folder has its own requirements.txt file. the process for setting up your environment look like

  • Move to the topic folder
    • cd <topic_folder>
  • Create a virtual environment
    • On Mac: python3 -m venv .venv
    • On Windows: python -m venv .venv
  • Activate the virtual environment
    • On Mac: source .venv/bin/activate
    • On Windows: .venv\Scripts\activate
  • Install dependencies
    • On Mac: pip3 install -r requirements.txt
    • On Windows: pip install -r requirements.txt
  • Call a specific script
    • On Mac: python3 <script_name>.py
    • On Windows: python <script_name>.py
  • Deactivate virtual environment
    • deactivate

See this video for additional commentary on Python Dev Environment Setup

Testing

  • Create a virtual environment
    • On Mac: python3 -m venv .venv
    • On Windows: python -m venv .venv
  • *Activate the virtual environment
    • On Mac: source .venv/bin/activate
    • On Windows: .venv\Scripts\activate
  • Install dependencies
    • On Mac: pip install -r requirements.txt
    • On Windows: pip install -r requirements.txt
  • Run tests
    • pytest -rA

Topics

Here's what you can find here:

Databases

  • Boards
    • 2D grid A simple representation of a 2D grid board that can be used for games like tic-tac-toe or checkers
    • Tic-tac-toe board A board based on a 2D Grid that is specialized for the rules of tic-tac-toe
  • Cards
    • Card deck A collection of cards that can be shuffled and dealt
    • Card deck factory A simplified way to construct various types of card decks
    • Playing card A representation of a standard playing card
  • Clients
  • Other
  • Fizz buzz A test that makes sure you can apply simple rules and cover all cases
  • Largest common prefix Consider what it means to have a common prefix and carfully enumerate the collection and individual characters of each word
  • Reverse linked list Reason about interactions with a data structure and carefully manipulate how the data is organized
  • Reverse string Understand how to split and join on delimiters
  • Swap numbers Write a few cryptic calculations to placate an interviewer trying to trick you
  • Two sum Simplify the problem space to find two numbers in a list that add up to a given number
  • Valid parens Check for valid brackets sequences by tracking nesting using a stack
  • Break even graph Visualize where sales break even with costs
  • Multiply matrices Solve a system of linear equations using matrices
  • Pie chart Use a math plotting library to create a pie chart and save it to a file
  • Plot Vectors Use a math plotting library to plot and annotate vectors

Support

  • How do I request a change?
    • Please submit an issue or a pull request
  • How fast will my request be added?
    • Probably not very fast for requests outside of a support package because this repo is maintained by a working professional
    • If you require fast, predictable responses, please purchase a support package
  • Can support packages be purchased?
    • Yes, various support packages can be purchased and customized for your needs. Support areas available include:
    • On demand support videos
    • 1:1 and team coaching
    • New features and other modifications

License

Licensed under

About

A collection of random Python solutions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published