# Using Python to create a solar system
If anyone is looking for a fun exercise to flex their #Python #coding fingers…
Using just gravitational attraction between bodies, you can create your own 2D solar system with as many stars and planets as you want. Here's a binary star system with some relatively stable planets
Here's the article, including a detailed step-by-step tutorial, if you want to read more: **[Simulating Orbiting Planets in a Solar System Using Python](https://thepythoncodingbook.com/2021/09/29/simulating-orbiting-planets-in-a-solar-system-using-python-orbiting-planets-series-1/)**
#Python #simulation #animation
…and there's also a 3D version _(next post)_
# 3D Solar System Using Matplotlib
The 3D version uses #matplotlib for the animation
Here's the article: **[Simulating a 3D Solar System In Python Using Matplotlib](https://thepythoncodingbook.com/2021/12/11/simulating-3d-solar-system-python-matplotlib/)**
@mattkram Yes, I find that I need to focus either on the coding aspect or on the science aspect, but you can't really do both–the article is already long as it is!
Agreed, in _real-world_ cases, the dynamic aspect adds an extra dimension which can help convey the results, in some cases, of course!