Project: Learn and Install Jupyter Notebook, 6/12

I’m having issues at this point, my code is returning an error message. someone please advice on how to resolve. See code and error message below:

def welcome():
a_variable = 'Welcome to ’ + a_string + ‘!’
return a_variable

dq = ‘Dataquest’
jn = ‘Jupyter Notebook’

welcome(dq)
welcome(jn)
welcome(py)

TypeErrorTraceback (most recent call last)
in ()
----> 1 welcome(dq)
2 welcome(jn)
3 welcome(py)

TypeError: welcome() takes 0 positional arguments but 1 was given

You did not add an argument into your function, it should be:
def welcome(a_string):

You can see that from the error message: TypeError: welcome() takes 0 positional arguments but 1 was given

When calling the function:
welcome(dq)
welcome(jn)
welcome(py)
you gave one argument (dq, jn and py) but the function is not set up to take an argument in first place, the parentheses were empty. Hence the error: ‘You gave me an argument but there is no place for me to put it’.

1 Like

I realized it and it worked out fine. I closed the ticket after I was able to resolve it. Thank you Bojan for your support.