#Sorting on planet Twisted-3-7

There is a planet... in a galaxy far far away. It is exactly like our planet, but it has one difference:
#The values of the digits 3 and 7 are twisted.
Our 3 means 7 on the planet Twisted-3-7. And 7 means 3.

Your task is to create a method, that can sort an array the way it would be sorted on Twisted-3-7.

7 Examples from a friend from Twisted-3-7:
```
[1,2,3,4,5,6,7,8,9] -> [1,2,7,4,5,6,3,8,9]
[12,13,14] -> [12,14,13]
[9,2,4,7,3] -> [2,7,4,3,9]
```

There is no need for a precheck. The array will always be not null and will always contain at least one number.

You should not modify the input array!

Have fun coding it and please don't forget to vote and rank this kata! :-) 

I have also created other katas. Take a look if you enjoyed this kata!

Difficulty: EASY
Starter code: def sort_twisted37(arr):
	

Solutions:
def sort_twisted37(arr):

	def key(x):
		return int(str(x).translate(str.maketrans('37', '73')))
	return sorted(arr, key=key)


tr = str.maketrans('37', '73')

def sort_twisted37(arr):
	return sorted(arr, key=lambda n: int(str(n).translate(tr)))


def sort_twisted37(arr):
	twisted = lambda n: int(''.join(('3' if c == '7' else '7' if c == '3' else c for c in str(n))))
	return sorted(arr, key=twisted)


def sort_twisted37(lst):
	return sorted(lst, key=comp)

def comp(n):
	return int(str(n).translate(str.maketrans('37', '73')))


trans = str.maketrans('37', '73')
twist = lambda n: int(str(n).translate(trans))

def sort_twisted37(arr):
	return sorted(arr, key=twist)


def sort_twisted37(arr):
	str_arr = [str(i) for i in arr]
	swap1(str_arr)
	str_arr = sorted([int(i) for i in str_arr])
	str_arr = [str(i) for i in str_arr]
	swap1(str_arr)
	return [int(i) for i in str_arr]

def swap1(str_arr):
	for (index, numstr) in enumerate(str_arr):
		if '3' in numstr or '7' in numstr:
			str_arr[index] = numstr.replace('3', '%temp%').replace('7', '3').replace('%temp%', '7')


tbl = str.maketrans('37', '73')

def twist(n):
	return int(str(n).translate(tbl))

def sort_twisted37(arr):
	return sorted(arr, key=twist)


sort_twisted37 = lambda a: sorted(a, key=lambda n: int(str(n).translate(str.maketrans('37', '73'))))