Nov-04-2020, 06:28 PM
(Nov-04-2020, 06:02 PM)DeaD_EyE Wrote:(Nov-04-2020, 05:52 PM)beginner2020 Wrote: I got the below error, using python version 2.7.5. Will that be due to version.
date_str, _ = line.split(maxsplit=1)
TypeError: split() takes no keyword arguments
I saw it too late.
You should avoid the use of Python 2.7. It's end of life.
Python 3.6 is the oldest available version which has still support.
Python 3.5 has also reached the end of life.
That maxsplit can be a keyword-argument was introduced with Python 3.3.
Start your repl or script withpython3
.
Justpython
without a 3 will start the Python 2.7 interpreter on the most distributions.
Hi
Thanks for the suggestion. Changed the environment to python 3.6 .Executed the code and got the below error.
date_str, _ = line.split(maxsplit=1)
ValueError: not enough values to unpack (expected 2, got 0)
Not able to figure the error. Could you please advise.