Ok, stuck on another Python Question. I have tried this a few times, but can’t seem to figure it out.
Question: Implement a function startString( char, stringlist) that returns a list of all strings in the list that begin with the character char.
startString('s',["simple", "to", "do", "some","things"])
This is what I have tried thus far and I know it doesn’t work:
def startString(char, stringlist):
newlist = []
for i in stringlist:
if stringlist[0] == char:
newlist.append(stringlist)
print newlist
Thank for any help that is offered.
try this: