Before We Begin: Can't even begin


#1

The object of the exercise is to create an argument that accepts no input, but always returns a single answer.

def answer():
    return answer("42")

Shouldn't this work?


#2

No, it will not work. When you use answer("42") you are passing an argument to answer(). If you want to return a single answer just use return 42. If you wanted to return a string you would need to encapsulate the string in quotes. For example
return "This is a single string"


#3

Very helpful. Thank you.


#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.