My task is to:
Write a function, starts_with(word, chs) that returns whether or not the string word begins with one of the characters in the list chs.
If word is an empty string, return False.
If chs is an empty list, return False.
I'm passing 6/7 test cases except for one which shows an Assertion error, however, I don't know what input is being used in each test case so I can't figure out the issue. What could the issue be?
def starts_with(word, chs):
x = 0
if (len(chs)== 0) or (word == ""):
return (False)
while x < len(chs):
s = word[0]
if s == chs[x]: {
}
x += 1
return (True)
word = ()
chs = ()