Python function

Since you opened a new thread about the chart question, please mark this one solved so people won't spend any more time on it.