human
Convert String into Binary Sequence | utility function.
convert each char to ASCII value.
Convert ASCII value to binary.
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to convert String into Binary Sequence and the other steps required.
 def strToBinary ( s ) :
	bin_conv = [ ]
	for c in s :
		ascii_val = ord ( c )
		binary_val = bin ( ascii_val )
		bin_conv . append ( binary_val [ 2 : ] )
	return ( ' ▁ ' . join ( bin_conv ) )
if __name__ == ' _ _ main _ _ ' :
	s = ' geeks '
print ( strToBinary ( s ) )