Skip to content

Some scripts i had fun creating, to learn the basics of python

License

Notifications You must be signed in to change notification settings

Wason1797/Fun-Python

Repository files navigation

Fun Python

This library is a fun little project; most of the programs are my take on The Coding Train's coding challenges

How to use

You can se the document here

Some of the projects i made

  • Python Basics
    • Simple syntax and operations in python first_app.py
    • A test file, it's not super important, contains a simple matrix class test_file.py
    • Introduction to turtle graphics, recursive spiral exercise recursive_spiral.py
    • Basic bubble sorting with lexicographical string ordering Sorting.py
    • A nice problem of dynamic programing taked from HackerEarth WithoutStatement.py
    • An algorithm to count all vowels on all posible substrings of a mother string, (not super effiecient) VowelCount.py
  • Fractal Trees
  • 3D graphics and shapes with pygame
    • 3D cube render with rotation (using matrix operations) 3D_render.py
    • 3D Lorentz Attractor, also with the same approach as before lorentz..py
    • Lemniscata, this drawing looks as the infinity symbol (this one is 2D) lemniscata.py
  • Snake Game
    • Simple snake game, this one was taken from a popular YouTube video sanake.py
  • Traveling Salesperson problem
    • Lexicographic order approach -> this one is like brute forcing into the solution, not super fast LexSalesperson.py
    • Genetic algorithm approach -> this one is more fun, i implemented this one with cross-over and mutation, also I select my population in a random way without repetition, it may need some improvements tho genSalesperson.py
  • Tensorflow
    • Linear Regression with gradient descent but no interactivity tsExample.py
    • Linear Regression with gradient descent optimizer and interactivity, this script allows you to provide the points on a canvas, so the computer will adjust a line and show it to you tsLinearRegression.py
    • Polynomial Regression, quadratic approach with interactivity (same as the linear one) tsPolyRegression.py
    • Function approximation using Tensor Flow with a simple neural network, you can find more details of the project in the Jupyter notebook. Function_Approximation

Resources

Coding Train's YouTube channel and all de documentation on the tools i used. I will provide the concrete resources (links to videos and such) I used on another time, I need to gather them all again

Tools

  • pygame
  • numpy
  • tensorflow
  • turtle