human
Check if two strings are permutation of each other | function to check whether two strings are Permutation of each other.
Get lengths of both strings.
If length of both strings is not same , then they cannot be Permutation.
Sort both strings.
Compare sorted strings.
Driver Code"
How can the above be solved in Python?

Write me a code to check if two strings are permutation of each other and the other steps required?
assistant
#Here is code to check if two strings are permutation of each other and the other steps required.
 def arePermutation ( str1 , str2 ) :
	n1 = len ( str1 )
	n2 = len ( str2 )
	if ( n1 != n2 ) :
		return False
	a = sorted ( str1 )
	str1 = " ▁ " . join ( a )
	b = sorted ( str2 )
	str2 = " ▁ " . join ( b )
	for i in range ( 0 , n1 , 1 ) :
		if ( str1 [ i ] != str2 [ i ] ) :
			return False
	return True
if __name__ == ' _ _ main _ _ ' :
	str1 = " test "
	str2 = " ttew "
	if ( arePermutation ( str1 , str2 ) ) :
		print ( " Yes " )
	else :
		print ( " No " )