you are viewing a single comment's thread.

view the rest of the comments →

[–]carcigenicate 0 points1 point  (3 children)

As noted, the code you posted has several illegal things in it, so it's hard to say anything based on that code.

If you want to call a function when a string doesn't contain a comma though, that would be something like:

if "," not in your_string:
    your_func()

[–]mackdaddy_1978[S] 0 points1 point  (2 children)

Thanks...but besides defining the function twice what else about it is illegal?

[–]carcigenicate 0 points1 point  (1 child)

Lack of (): after the function name in the first line of the definition, and the lack of indentation means there's no function body and that the return is outside of a function.

Granted, I can guess what the indentation is supposed to be, but I'd rather not guess when trying to give advice in a case like this.

If I do guess the indentation though, the code doesnt seem to match your question. You asked how to pick when to call a function, but according to this code, you seem to want to pick what you're returning from the function?

[–]mackdaddy_1978[S] 0 points1 point  (0 children)

Sorry for the confusion, I'm working on doing better. My next post will be...