Answer:
In Python:
def filter_only_str(mylist):
for x in mylist:
if isinstance(x, str) == False:
mylist.remove(x)
return mylist
Step-by-step explanation:
The function is not given. So, I write from scratch.
In Python:
This defines the function
def filter_only_str(mylist):
This iterates through the list
for x in mylist:
This checks if list item is not string
if isinstance(x, str) == False:
If true that list item is not string, the item is removed from the list
mylist.remove(x)
Return list
return mylist