wildcard python solution