PythonCode Calculate persentage and plot graph