Sep-07-2022, 04:35 PM
One other point is that you are doing a very bad habit of naming functions the same as system functions. Redefining print() means you cannot use print() in the function (or else it becomes recursive). next() should also be avoided.
And, for good advice regarding style of Python programming, see PEP 8 at PEP 8
And, for good advice regarding style of Python programming, see PEP 8 at PEP 8