练习

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

#输出第一个参数中的且在其他参数中都出现过的字符,出现几次输出几次
#!/usr/bin/python
def intersect(*args):
	print 'args[0]:',str(args[0])
	print 'args[1:]:',str(args[1:])
	ress = []
	for x in args[0]:
		for other in args[1:]:
			if x not in other:
				break
			else:
				ress.append(x)
	return ress

s1 = 'spam'
s2 = 'scam'
s3 = 'sobm'
pp = intersect(s1,s2,s3)
print pp