I'm a Python newbie, but I know that I can allow a variable number of multiple arguments in a function using *args.
This script looks for a word in any number of string *sources:
def find(word, *sources):
for i in list(sources):
if word in i:
return True
source1 = "This is a string"
source2 = "This is Wow!"
if find("string", source1, source2) is True:
print "Succeed"
However, is it possible to specify "multiple" multiple arguments (*args) in one function? In this case, that would be looking for multiple *words in multiple *sources.
As in, figuratively:
if find("string", "Wow!", source1, source2) is True:
print "Succeed"
else:
print "Fail"
How can I make the script discern what is intended to be a word, and what's supposed to be a source?