Update tables.py

this program has been made by Josiah and has been commented for each of the processes of code. this code also has been done with all extention tasks completed and working