human
Write me a code to subsequences generated by including characters or ASCII value of characters of given string and the other steps required given the following:
Subsequences generated by including characters or ASCII value of characters of given string | Function to print subsequences containing ASCII value of the characters or the the characters of the given string.
Base Case.
If length of the subsequence exceeds 0.
Print the subsequence.
Stores character present at i - th index of str.
If the i - th character is not included in the subsequence.
Including the i - th character in the subsequence.
Include the ASCII value of the ith character in the subsequence.
Driver Code.
Stores length of str"
Solution in Python:
assistant
#Here is code to subsequences generated by including characters or ASCII value of characters of given string and the other steps required.
 def FindSub ( string , res , i ) :
	if ( i == len ( string ) ) :
		if ( len ( res ) > 0 ) :
			print ( res , end = " ▁ " ) ;
		return ;
	ch = string [ i ] ;
	FindSub ( string , res , i + 1 ) ;
	FindSub ( string , res + ch , i + 1 ) ;
	FindSub ( string , res + str ( ord ( ch ) ) , i + 1 ) ;
if __name__ == " _ _ main _ _ " :
	string = " ab " ;
	res = " " ;
	N = len ( string ) ;
	FindSub ( string , res , 0 ) ;