human
Convert string to integer without using any in | Function to convert string to integer without using functions.
Initialize a variable.
Iterate till length of the string.
Subtract 48 from the current digit.
Print the answer.
Driver code.
Given string of number.
Function Call"
Solution in Python:
assistant
#Here is code to convert string to integer without using any in and the other steps required.
 def convert ( s ) :
	num = 0
	n = len ( s )
	for i in s :
		num = num * 10 + ( ord ( i ) - 48 )
	print ( num )
if __name__ == ' _ _ main _ _ ' :
	s = "123"
	convert ( s )