human
Position of n among the numbers made of 2 , 3 , 5 & 7 | Program position of n among the numbers made of 2 , 3 , 5 & 7.
If number is 2 then it is on the position pos * 2 + 1.
If number is 3 then it is on the position pos * 2 + 2.
If number is 5 then it is on the position pos * 2 + 3.
If number is 7 then it is on the position pos * 2 + 4.
Driver code"
How can the above be solved in Python?

Give me a code to position of n among the numbers made of 2 , 3 , 5 & 7 and the other steps required?
assistant
#Here is code to position of n among the numbers made of 2 , 3 , 5 & 7 and the other steps required.
 def findpos ( n ) :
	pos = 0
	for i in n :
		if i == '2' :
			pos = pos * 4 + 1
		elif i == '3' :
			pos = pos * 4 + 2
		elif i == '5' :
			pos = pos * 4 + 3
		elif i == '7' :
			pos = pos * 4 + 4
	return pos
n = "777"
print ( findpos ( n ) )