In Math, an improper fraction is a fraction where the numerator (the top number) is greater than or equal to the denominator (the bottom number) For example: ```5/3``` (five third).

A mixed numeral is a whole number and a fraction combined into one "mixed" number. For example: ```1 1/2``` (one and a half) is a mixed numeral.

## Task

Write a function `convertToMixedNumeral` to convert the improper fraction into a mixed numeral.

The input will be given as a ```string``` (e.g. ```'4/3'```).

The output should be a ```string```, with a space in between the whole number and the fraction (e.g. ```'1 1/3'```).  You do not need to reduce the result to its simplest form.

For the purpose of this exercise, there will be no ```0```, ```empty string``` or ```null``` input value. However, the input can be:

- a negative fraction
- a fraction that does not require conversion
- a fraction that can be converted into a whole number

## Example

Difficulty: EASY
Tags: Fundamentals

Mathematics

Starter code:
def convert_to_mixed_numeral(parm):
	

Solutions:
def convert_to_mixed_numeral(parm):
	(a, b) = list(map(int, parm.split('/')))
	(d, r) = divmod(abs(a), b)
	s = (0 < a) - (a < 0)
	return parm if d == 0 else ('{}' + ' {}/{}' * (r != 0)).format(d * s, r, b)


def convert_to_mixed_numeral(parm):
	(sign, parm) = (parm[:'-' in parm], parm['-' in parm:])
	(numerator, denominator) = parm.split('/')
	(integer, numerator) = divmod(int(numerator), int(denominator))
	(integer, fraction) = (f"{integer or ''}", f'{numerator}/{denominator}' if numerator else '')
	return f"{sign}{integer}{(integer and fraction) and ' '}{fraction}"


def convert_to_mixed_numeral(parm):
	(numerator, denominator) = parm.split('/')
	(num, dem) = (int(numerator), int(denominator))
	(divide, mod) = (int(num / dem) or '', int(abs(num) % dem) or 0)
	if bool(divide) and bool(mod):
		return '%s %s/%s' % (divide, mod, denominator)
	else:
		return '%s/%s' % (int(mod) if num > 0 else int(-mod), int(denominator)) if bool(mod) else str(divide)


def convert_to_mixed_numeral(parm):
	(num, den) = map(int, parm.split('/'))
	(sign, num) = (num < 0, abs(num))
	if num < den:
		return parm
	(whole, num) = divmod(num, den)
	if num == 0:
		return '-' * sign + '%d' % whole
	return '-' * sign + '%d %d/%d' % (whole, num, den)


def convert_to_mixed_numeral(frac):
	(numerator, denominator) = (int(a) for a in frac.split('/'))
	(quo, rem) = divmod(abs(numerator), denominator)
	signed_quo = -quo if numerator < 0 else quo
	if quo == 0:
		return frac
	elif rem == 0:
		return '{}'.format(signed_quo)
	return '{}{}/{}'.format('{} '.format(signed_quo) if quo > 0 else '', rem, denominator)


def convert_to_mixed_numeral(parm):
	(p1, p2) = map(int, parm.split('/'))
	if abs(p1) < p2 and p1 != 0:
		return parm
	i = int(p1 / p2)
	q = p1 - i * p2
	return '{} {}/{}'.format(i, abs(q), p2) if q != 0 else '{}'.format(i)


def convert_to_mixed_numeral(parm):
	parts = tuple(map(int, parm.split('/')))
	(a, b) = (abs(parts[0]), parts[1])
	if a < b:
		mixed_numeral = '{}/{}'.format(a, b)
	elif a % b:
		mixed_numeral = '{} {}/{}'.format(a // b, a % b, b)
	else:
		mixed_numeral = str(a // b)
	if parts[0] < 0:
		mixed_numeral = '-{}'.format(mixed_numeral)
	return mixed_numeral


def convert_to_mixed_numeral(parm):
	lis = list(map(int, parm.split('/')))
	whole = abs(lis[0]) // lis[1]
	mod = abs(lis[0]) % lis[1]
	if lis[0] < 0:
		if mod == 0:
			return '-{}'.format(whole)
		elif whole != 0:
			return '-{0} {1}/{2}'.format(whole, mod, lis[1])
		else:
			return '-{0}/{1}'.format(mod, lis[1])
	elif mod == 0:
		return '{0}'.format(whole)
	elif whole != 0:
		return '{0} {1}/{2}'.format(whole, mod, lis[1])
	else:
		return '{0}/{1}'.format(mod, lis[1])


def convert_to_mixed_numeral(parm):
	(n, d) = list(map(int, parm.split('/')))
	sign = '-' if n < 0 else ''
	(m, n) = divmod(abs(n), d)
	return parm if m == 0 else sign + f'{m}' + f' {n}/{d}' * (n != 0)