This is a follow up from my kata Insert Dashes. 
Write a function ```insertDashII(num)``` that will insert dashes ('-') between each two odd numbers and asterisk ('\*') between each even numbers in ```num``` 
For example: 
```insertDashII(454793)``` --> 4547-9-3  
```insertDashII(1012356895)``` --> 10123-56*89-5 

Zero shouldn't be considered even or odd.

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def insert_dash2(num):
	

Solutions:
def insert_dash2(num):
	prev = 0
	out = ''
	for dig in str(num):
		if int(dig) % 2 == int(prev) % 2 and int(prev) and int(dig):
			out += '*-'[int(prev) % 2]
		out += dig
		prev = dig
	return out


import re

def insert_dash2(num):
	s = str(num)
	s = re.sub('(?<=[13579])(?=[13579])', '-', s)
	s = re.sub('(?<=[2468])(?=[2468])', '*', s)
	return s


import re

def insert_dash2(num):
	return re.sub('[13579](?=[13579])|[2468](?=[2468])', lambda m: m.group(0) + ('-' if int(m.group(0)) & 1 else '*'), str(num))


import re

def insert_dash2(num):
	a = re.sub('([2468])(?=[2468])', '\\1*', str(num))
	return re.sub('([13579])(?=[13579])', '\\1-', a)


def insert_dash2(num):
	snum = str(num)
	(evens, odds) = (frozenset('2468'), frozenset('13579'))
	res = []
	for (l, r) in zip(snum[:-1], snum[1:]):
		res.append(l)
		if l in evens and r in evens:
			res.append('*')
		elif l in odds and r in odds:
			res.append('-')
	res.append(snum[-1])
	return ''.join(res)


def insert_dash2(num):
	num = list(str(num))
	answer = ''
	for (index, obj) in enumerate(num):
		previous = num[index - 1]
		if index == 0 or int(obj) == 0 or int(previous) == 0:
			answer += obj
			continue
		elif int(obj) % 2 == 0 and int(previous) % 2 == 0:
			answer += '*' + obj
		elif int(obj) % 2 != 0 and int(previous) % 2 != 0:
			answer += '-' + obj
		else:
			answer += obj
			continue
	return answer


insert_dash2 = lambda n, r=__import__('re').sub, a='2468', b='13579': r(f'([{a}])(?=[{a}])', '\\1*', r(f'([{b}])(?=[{b}])', '\\1-', str(n)))


insert_dash2 = lambda x: ''.join([str(x)[i] + '-' if int(str(x)[i]) % 2 and int(str(x)[i + 1]) % 2 else str(x)[i] + '*' if not int(str(x)[i]) % 2 and (not int(str(x)[i + 1]) % 2) and ('0' not in [str(x)[i + 1], str(x)[i]]) else str(x)[i] for i in range(len(str(x)) - 1)]) + str(x)[-1]