#๐Ÿ”’ Anyone got any idea how i read this error message?

24 messages ยท Page 1 of 1 (latest)

tidal martenBOT
#

@deft spire

Python help channel opened

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.

primal flower
#

!e

def foo(x):
    pass


foo(y=10)
tidal martenBOT
# primal flower !e ```py 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 "/home/main.py", line 5, in <module>
003 |     foo(y=10)
004 |     ~~~^^^^^^
005 | TypeError: foo() got an unexpected keyword argument 'y'
deft spire
primal flower
#

It's saying subset is not a parameter of the duplicated function

deft spire
#

and what does that mean?

primal flower
#

Do you know what a function is?

deft spire
#

A block of code where we put one or more inputs and get specific results tied to the variables/inputs we put in?

primal flower
#

Do you know what a parameter is?

deft spire
primal flower
#

Parameters are the "inputs" of the function

deft spire
#

ok

primal flower
#

They are what the function expects to be able to run properly

primal flower
#

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?

deft spire
#

this code is mine and i am trying things, as about where i learn it from a youtube tutorial

primal flower
#

I'd really recommend learning the basics of python before diving into what looks quite advanced

deft spire
#

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

tidal martenBOT
#
Python help channel closed for inactivity

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.