#๐ Anyone got any idea how i read this error message?
24 messages ยท Page 1 of 1 (latest)
@deft spire
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
!e
def foo(x):
pass
foo(y=10)
:x: Your 3.13 eval job has completed with return code 1.
001 | Traceback (most recent call last):
002 | File [35m"/home/main.py"[0m, line [35m5[0m, in [35m<module>[0m
003 | [31mfoo[0m[1;31m(y=10)[0m
004 | [31m~~~[0m[1;31m^^^^^^[0m
005 | [1;35mTypeError[0m: [35mfoo() got an unexpected keyword argument 'y'[0m
huh?
It's saying subset is not a parameter of the duplicated function
and what does that mean?
Do you know what a function is?
A block of code where we put one or more inputs and get specific results tied to the variables/inputs we put in?
Do you know what a parameter is?
nope
Parameters are the "inputs" of the function
ok
They are what the function expects to be able to run properly
In my example here, function foo expects a parameter named x
but I gave it something called y when I called it
That's the same as your scenario
the duplicate() function doesn't have a parameter named subset, but you tried to give it one
Where did this code come from?
this code is mine and i am trying things, as about where i learn it from a youtube tutorial
I'd really recommend learning the basics of python before diving into what looks quite advanced
maybe but i am confused because before it worked fine
as for parameters and functions i don't know the exact words in since i learned what i learned in a different language
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.