How can an and operator be emulated in regular expressions in Python?
Specifically, I want to return a match on a string if and only if 2 or more
substrings all appear in the string. For example, for a string s = 'Jones
John' and substrings sg0 = 'Jones' and sg1 = 'John', I want to return a
match
Few questions. I have a module "combin" which contains "Combin" and "Prob"
classes. This is the "Prob" class:
class Prob:
def binprob(self,n,k,p):
fewerthan = sum([Combin().kcomb(n,i)*((p**i)*(1-p)**(n-i)) for i in
range(k)])
exact = Combin().kcomb(n,k)*((p**k)*(1-p)**(n-k))