human
Find the real and imaginary part of a Complex number | Function to find real and imaginary parts of a complex number.
string length stored in variable l.
variable for the index of the separator.
Storing the index of '+.
else storing the index of '-.
Finding the real part of the complex number.
Finding the imaginary part of the complex number.
Driver code"
How can the above be solved in Python?

Can you provide a code to find the real and imaginary part of a Complex number and the other steps required?
assistant
#Here is code to find the real and imaginary part of a Complex number and the other steps required.
 def findRealAndImag ( s ) :
	l = len ( s )
	i = 0
'
	if ( s . find ( ' + ' ) != - 1 ) :
		i = s . find ( ' + ' )
'
	else :
		i = s . find ( ' - ' ) ;
	real = s [ : i ]
	imaginary = s [ i + 1 : l - 1 ]
	print ( " Real ▁ part : " , real )
	print ( " Imaginary ▁ part : " , imaginary )
s = "3 + 4i " ;
findRealAndImag ( s ) ;