human
Count of subsets not containing adjacent elements | Function to return the count of possible subsets.
If previous element was 0 then 0 as well as 1 can be appended.
If previous element was 1 then only 0 can be appended.
Store the count of all possible subsets.
Driver code"
How can the above be solved in Python?

=====
What is a code to count of subsets not containing adjacent elements and the other steps required?
assistant
#Here is code to count of subsets not containing adjacent elements and the other steps required.
 def cntSubsets ( arr , n ) :
	a = [ 0 ] * n
	b = [ 0 ] * n ;
	a [ 0 ] = b [ 0 ] = 1 ;
	for i in range ( 1 , n ) :
		a [ i ] = a [ i - 1 ] + b [ i - 1 ] ;
		b [ i ] = a [ i - 1 ] ;
	result = a [ n - 1 ] + b [ n - 1 ] ;
	return result ;
if __name__ == " _ _ main _ _ " :
	arr = [ 3 , 5 , 7 ] ;
	n = len ( arr ) ;
	print ( cntSubsets ( arr , n ) ) ;