My c code and python code which has done so far