Write a function that accepts an array of 10 integers (between 0 and 9), that returns a string of those numbers in the form of a phone number.

Example:

```python
create_phone_number([1, 2, 3, 4, 5, 6, 7, 8, 9, 0]) # => returns "(123) 456-7890"
```
```f#
createPhoneNumber [1; 2; 3; 4; 5; 6; 7; 8; 9; 0] // => returns "(123) 456-7890"
```

The returned format must be correct in order to complete this challenge. 
Don't forget the space after the closing parentheses!

Source: codewars | Difficulty: EASY
Tags: String algorithms

Data structures

Starter code: def create_phone_number(n):
	

Solutions:
def create_phone_number(n):
	return '({}{}{}) {}{}{}-{}{}{}{}'.format(*n)


def create_phone_number(n):
	n = ''.join(map(str, n))
	return '(%s) %s-%s' % (n[:3], n[3:6], n[6:])


def create_phone_number(n):
	str1 = ''.join((str(x) for x in n[0:3]))
	str2 = ''.join((str(x) for x in n[3:6]))
	str3 = ''.join((str(x) for x in n[6:10]))
	return '({}) {}-{}'.format(str1, str2, str3)


def create_phone_number(n):
	n = ''.join([str(x) for x in n])
	return '(' + str(n[0:3]) + ')' + ' ' + str(n[3:6]) + '-' + str(n[6:])


def create_phone_number(n):
	return '(%i%i%i) %i%i%i-%i%i%i%i' % tuple(n)


def create_phone_number(n):
	m = ''.join(map(str, n))
	return f'({m[:3]}) {m[3:6]}-{m[6:]}'


create_phone_number = lambda n: f'({n[0]}{n[1]}{n[2]}) {n[3]}{n[4]}{n[5]}-{n[6]}{n[7]}{n[8]}{n[9]}'


def create_phone_number(n):
	d = '('
	for i in range(len(n)):
		if i < 3:
			d = d + str(n[i])
			if i == 2:
				d = d + ') '
		elif i >= 3 and i < 6:
			d = d + str(n[i])
			if i == 5:
				d = d + '-'
		elif i >= 6 and i < 10:
			d = d + str(n[i])
	return d


def create_phone_number(n):
	n = list(map(str, n))
	return '({}) {}-{}'.format(''.join(n[:3]), ''.join(n[3:6]), ''.join(n[6:10]))


from functools import reduce

def create_phone_number(n):
	return reduce(lambda a, c: a.replace('x', c, 1), list(map(str, n)), '(xxx) xxx-xxxx')