# Convert Improper Fraction to Mixed Number

You will need to convert an [improper fraction](https://www.mathplacementreview.com/arithmetic/fractions.php#improper-fractions) to a [mixed number](https://www.mathplacementreview.com/arithmetic/fractions.php#mixed-number). For example:

```python
get_mixed_num('18/11') # Should return '1 7/11'
get_mixed_num('13/5') # Should return '2 3/5'
get_mixed_num('75/10') # Should return '7 5/10'
```

NOTE: All fractions will be greater than 0.

Source: codewars | Difficulty: EASY
Tags: String algorithms

Fundamentals

Mathematics

Starter code: def get_mixed_num(fraction):
	

Solutions:
def get_mixed_num(fraction):
	(n, d) = [int(i) for i in fraction.split('/')]
	return '{} {}/{}'.format(n // d, n % d, d)


def get_mixed_num(f):
	[a, b] = map(int, f.split('/'))
	return '{} {}/{}'.format(a // b, a % b, b)


def get_mixed_num(f):
	(n, d) = map(int, f.split('/'))
	return '%d %d/%d' % (n / d, n % d, d)


def get_mixed_num(fraction):
	(n, d) = (int(num) for num in fraction.split('/'))
	(i, n) = divmod(n, d)
	return f'{i} {n}/{d}'


def get_mixed_num(f):
	(v, d) = map(int, f.split('/'))
	(n, r) = divmod(v, d)
	return f'{n} {r}/{d}'


def get_mixed_num(fraction):
	(a, b) = map(int, fraction.split('/'))
	(q, r) = divmod(a, b)
	return f'{q} {r}/{b}'


def get_mixed_num(fraction):
	(a, b) = list(map(int, fraction.split('/')))
	return '{} {}/{}'.format(a // b, a % b, b)


def get_mixed_num(fraction):
	arr = fraction.split('/')
	(a, b) = divmod(int(arr[0]), int(arr[1]))
	res = []
	if a != 0:
		res.append(str(a))
	if b != 0:
		res.append(str(b) + '/' + arr[1])
	return ' '.join(res)


def get_mixed_num(fraction):
	(n, d) = map(int, fraction.split('/'))
	(a, b) = divmod(n, d)
	return f'{a} {b}/{d}'


def get_mixed_num(fraction):
	(n, d) = map(int, fraction.split('/'))
	(i, n, d) = (n // d, n % d, d)
	return ['', f'{i} '][bool(i)] + f'{n}/{d}'