-3

I'm new to coding so this is probably a really easy question for you all. But I'm trying to take the first and last character of a word and see if it's sequential in that word (not alphabetically). For example, 'banana' would be sequential because 'ba' appears in the word. However, 'house' would not be sequential because 'he' does not appear in the word. If a word is sequential, it returns "True", if not "False". I'm writing this in python. Thanks!

  • 1
    Please, check [ask] and [how to ask homework questions](https://meta.stackoverflow.com/q/334822/4046632). What have you tries? – buran Feb 10 '22 at 05:13

1 Answers1

0
def seq(s):
   if (s[0]+s[-1]) in s:
      return True
   return False
print(seq(s))
zeeshan12396
  • 382
  • 1
  • 8