Write
```python
function repeating_fractions(numerator, denominator)
```
that given two numbers representing the numerator and denominator of a fraction, return the fraction in string format. If the fractional part has repeated digits, replace those digits with a single digit in parentheses. 

For example:
```python
repeating_fractions(1,1) === '1'
repeating_fractions(1,3) === '0.(3)'
repeating_fractions(2,888) === '0.(0)(2)5(2)5(2)5(2)5(2)5(2)'
```

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def repeating_fractions(n,d):
	

Solutions:
import re

def repeating_fractions(n, d):
	(i, d) = str(n * 1.0 / d).split('.')
	return i + '.' + re.sub('([0-9])\\1+', '(\\1)', d)


repeating_fractions = lambda n, d: __import__('re').sub('(\\d)(\\1+)(?!\\.)', '(\\1)', str(n / float(d)))


import re

def repeating_fractions(num, den):
	(d, f) = str(num / den).split('.')
	return '{}.{}'.format(d, re.sub('(\\d)\\1+', '(\\1)', f))


def repeating_fractions(n, d):
	(a, b, c) = str(n * 1.0 / d).partition('.')
	return a + b + __import__('re').sub('(.)\\1+', lambda x: '(%s)' % x.group(1), c)


import re

def repeating_fractions(n, d):
	ok = str((n + 0.0) / d).split('.')
	return ok[0] + '.' + re.sub('(\\d)\\1+', '(\\1)', ok[1])


repeating_fractions = lambda n, d: str((n + 0.0) / d).split('.')[0] + '.' + ''.join([['({})'.format(i), i][len(list(j)) == 1] for (i, j) in __import__('itertools').groupby(str((n + 0.0) / d).split('.')[1])])


from itertools import groupby

def repeating_fractions(numerator, denominator):
	(integer, fractional) = str(numerator / float(denominator)).split('.')
	grouped = []
	for (k, g) in groupby(fractional):
		try:
			next(g)
			next(g)
			grouped.append('({})'.format(k))
		except StopIteration:
			grouped.append(k)
	return '{}.{}'.format(integer, ''.join(grouped))


from re import sub
repeating_fractions = lambda n, d: (lambda div: (lambda index: div[:index] + sub('(\\d)\\1+', '(\\g<1>)', div[index:]))(div.index('.')))(str(1.0 * n / d))


from re import sub

def repeating_fractions(n, d):
	return sub('(\\d)\\1+(?!\\d*\\.)', lambda m: f'({m[1]})', str(n / d))


import re

def repeating_fractions(numerator, denominator):
	ss = str(numerator / denominator).split('.')
	for x in range(0, 10):
		ss[1] = re.sub('[' + str(x) + ']{2,}', '(' + str(x) + ')', ss[1])
	return '.'.join(ss)


def repeating_fractions(n, d):
	a = str(n / d).split('.')
	(pos, out, m) = (0, '', False)
	while pos < len(a[1]) - 1:
		if a[1][pos] == a[1][pos + 1]:
			m = True
		else:
			out += m * '(' + a[1][pos] + m * ')'
			m = False
		pos += 1
	out += m * '(' + a[1][-1] + m * ')'
	return a[0] + '.' + out


from itertools import groupby

def repeating_fractions(numerator, denominator):
	(int_number, fraction) = str(numerator / float(denominator)).split('.')
	group = []
	for (i, j) in groupby(fraction):
		try:
			next(j)
			next(j)
			group.append('({})'.format(i))
		except StopIteration:
			group.append(i)
	return '{}.{}'.format(int_number, ''.join(group))


import re

def repeating_fractions(a, b):
	if not a % b:
		return str(a / b)
	(a, b) = str(a / b).split('.')
	return a + '.' + re.sub('(.)\\1+', '(\\1)', b)


import re

def repeating_fractions(q, b):
	return re.sub('(\\d)\\1+(?!\\.)', '(\\1)', str(q / b))


import re

def repeating_fractions(q, b):
	(x, y) = str(q / b).split('.')
	return x + '.' + re.sub('(\\d)\\1+', '(\\1)', y)


from itertools import groupby

def repeating_fractions(numerator, denominator):
	(int_part, fraction_part) = str(numerator / denominator).split('.')
	return int_part + '.' + ''.join((f'({key})' if len(list(group)) > 1 else key for (key, group) in groupby(fraction_part)))


import re

def repeating_fractions(numerator, denominator):
	fracion = str(numerator / denominator).split('.')
	beforeDot = fracion[0]
	afterDot = fracion[1]
	properAfterDOT = ''
	pharenthesis = [item[0] for item in re.findall('((.)\\2*)', afterDot)]
	for i in pharenthesis:
		if len(i) > 1:
			properAfterDOT += '(' + i[0] + ')'
		else:
			properAfterDOT += i
	return beforeDot + '.' + properAfterDOT


def repeating_fractions(num, denom):
	ans = str(num / denom)
	decimat_at = ans.find('.')
	start = ans[decimat_at + 1]
	zgroup = ''
	retval = ans[0:decimat_at + 1]
	for iii in range(decimat_at + 1, len(ans) - 1):
		end = ans[iii + 1]
		if start == end:
			zgroup += end
			continue
		elif start != end and len(zgroup) > 0:
			retval += '(' + zgroup[0] + ')'
			zgroup = ''
			start = ans[iii + 1]
		elif start != end and len(zgroup) == 0:
			retval += start
			zgroup = ''
			start = ans[iii + 1]
		else:
			pass
	end = ans[len(ans) - 1]
	if zgroup == '':
		retval += start
	elif len(zgroup) > 1 or start == end:
		retval += '(' + zgroup[0] + ')'
	return retval


from itertools import groupby

def repeating_fractions(a, b):
	(arr, idx) = ([''.join(grp) for (num, grp) in groupby(str(a / b))], 2)
	while idx < len(arr):
		if len(arr[idx]) > 1:
			arr[idx] = f'({arr[idx][0]})'
		idx += 1
	return ''.join(arr)


from itertools import groupby

def repeating_fractions(n, d):
	(x, y) = str(n / d).split('.')
	return f'{x}.' + ''.join((f'({k})' if len(list(g)) > 1 else k for (k, g) in groupby(y)))