Does anyone else get this error? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Does anyone else get this error?

https://code.sololearn.com/c95X32cpwwPl/?ref=app Idk if this is a problem only on my device or not, but I was working on a code and then at one moment I started getting an Error message that says "list function can only take at most one argument, two were given." I tried changing list to tuple, but that didn't work either. Then I just created a very simple code to check if list() function works at all, and found out it doesn't, and it only accepts one argument. Can someone please explain what's happening and why?

14th Aug 2018, 11:10 PM
Artem Khaiet
Artem Khaiet - avatar
3 Answers
+ 2
print(list.__doc__) Built-in mutable sequence. If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified. The last line is the one that applies here.
14th Aug 2018, 11:26 PM
Kirk Schafer
Kirk Schafer - avatar
+ 2
You can create the array that create the list() a = [ "a", "b", ] print(a)
14th Aug 2018, 11:18 PM
program
program - avatar
+ 1
I agree with Kirk Schafer but the code is short.
14th Aug 2018, 11:28 PM
program
program - avatar