Purging an application removes everything regarding it on your computer. Since lots of the OS is based on Python, removing it can harm the OS. You should never have a need to purge, instead, I always recommend remove instead. Unlike purge, remove will not remove the configuration files of the program, only the program itself.
For example: sudo apt-get purge <packagename>
becomes sudo apt-get remove <packagename>
.
The first answer of this question further explains the differences between purge and remove if you need more clarification :).
In order to fix your potentially broken system, I recommend reinstalling Python3. Run sudo apt-get install --install-recommends python3
to reinstall Python3 and dependencies that could have also been removed. If it says that it is already installed, then sudo apt-get install --reinstall python3
.
Hopefully this helps you :).