Python question help?

Write an expression that returns False if the str associated with s begins with "ecto" .

2 Answers

  • not s.startswith('ecto')

    is what you're searching for, or if you wrap it in a function:

    def some_function(s): return not s.startswith('ecto')

  • False if s[0:4] == "ecto" else True

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Posts