human
Can you provide a code to modify characters of a string by adding integer values of same and the other steps required given the following:
Modify characters of a string by adding integer values of same | Function to modify a given string by adding ASCII value of characters from a string S to integer values of same indexed characters in string N.
Traverse the string.
Stores integer value of character in string N.
Stores ASCII value of character in string S.
If b exceeds 122.
Replace the character.
Print resultant string.
Driver Code.
Given strings.
Function call to modify string S by given operations"
Solution in Python:
assistant
#Here is code to modify characters of a string by adding integer values of same and the other steps required.
 def addASCII ( S , N ) :
	for i in range ( len ( S ) ) :
		a = ord ( N [ i ] ) - ord ( '0' )
		b = ord ( S [ i ] ) + a
		if ( b > 122 ) :
			b -= 26
		S = S . replace ( S [ i ] , chr ( b ) )
	print ( S )
if __name__ == " _ _ main _ _ " :
	S = " sun "
	N = "966"
	addASCII ( S , N )