human
Write me a code to program to Encrypt a String using ! and @ and the other steps required given the following:
Program to Encrypt a String using ! and @ | Function to encrypt the string.
evenPos is for storing encrypting char at evenPosition oddPos is for storing encrypting char at oddPosition.
Get the number of times the character is to be repeated.
if i is odd , print ' ! ' else print '@.
Driver code.
Encrypt the String"
How can the above be solved in Python?
assistant
#Here is code to program to Encrypt a String using ! and @ and the other steps required.
 def encrypt ( input_arr ) :
	evenPos = ' @ ' ; oddPos = ' ! ' ;
	for i in range ( len ( input_arr ) ) :
		ascii = ord ( input_arr [ i ] ) ;
		repeat = ( ascii - 96 ) if ascii >= 97 else ( ascii - 64 ) ;
		for j in range ( repeat ) :
'
	if ( i % 2 == 0 ) :
		print ( oddPos , end = " " ) ;
	else :
		print ( evenPos , end = " " ) ;
if __name__ == " _ _ main _ _ " :
	input_arr = [ ' A ' , ' b ' , ' C ' , ' d ' ] ;
	encrypt ( input_arr ) ;