I am shifting to Python, and am still relatively new to the pythonic approach. I want to write a function that takes a string and a list and returns true if all the elements
If you're not worried about repeat characters, then:
def myfunc(string, seq):
return set(seq).issubset(string)
And, untested, if you do care about repeated characters, then maybe (untested):
from collections import Counter
def myfunc(string, seq):
c1 = Counter(string)
c2 = Counter(seq)
return not (c2 - c1)