human
Minimum cost to convert given string to consist of only vowels | Function to find the minimum cost.
Store vowels.
Loop for iteration of string.
Loop to calculate the cost.
Add minimum cost.
Given String.
Function Call"
How can the above be solved in Python?
 ... Give me a code to minimum cost to convert given string to consist of only vowels and the other steps required?
assistant
#Here is code to minimum cost to convert given string to consist of only vowels and the other steps required.
 def min_cost ( st ) :
	vow = " aeiou "
	cost = 0
	for i in range ( len ( st ) ) :
		costs = [ ]
		for j in range ( 5 ) :
			costs . append ( abs ( ord ( st [ i ] ) - ord ( vow [ j ] ) ) )
		cost += min ( costs )
	return cost
str = " abcde "
print ( min_cost ( str ) )