"""simple docstring"""






from __future__ import annotations

from typing import Any




def 						SCREAMING_SNAKE_CASE					(  __UpperCAmelCase       )							->   None:
				create_state_space_tree(__UpperCAmelCase  ,					[]  ,					0       )




def 						SCREAMING_SNAKE_CASE					(  __UpperCAmelCase  ,					__UpperCAmelCase  ,					__UpperCAmelCase       )							->   None:

				if index == len(__UpperCAmelCase       ):
								print(__UpperCAmelCase       )
								return

				create_state_space_tree(__UpperCAmelCase  ,					__UpperCAmelCase  ,					index + 1       )
				current_subsequence.append(sequence[index]       )
				create_state_space_tree(__UpperCAmelCase  ,					__UpperCAmelCase  ,					index + 1       )
				current_subsequence.pop()


if __name__ == "__main__":
						_A   					=	[3, 1, 2, 4]
						generate_all_subsequences(seq)

						seq.clear()
						seq.extend(['A', 'B', 'C'])
						generate_all_subsequences(seq)





"""simple docstring"""






def 						SCREAMING_SNAKE_CASE					(  __UpperCAmelCase       )							->   int:

				if not isinstance(__UpperCAmelCase  ,					__UpperCAmelCase       ):
								raise ValueError("multiplicative_persistence() only accepts integral values"       )
				if num < 0:
								raise ValueError("multiplicative_persistence() does not accept negative values"       )

				SCREAMING_SNAKE_CASE__		  =				0
				SCREAMING_SNAKE_CASE__		  =				str(__UpperCAmelCase       )

				while len(__UpperCAmelCase       ) != 1:
								SCREAMING_SNAKE_CASE__		  =				[int(__UpperCAmelCase       ) for i in num_string]

								SCREAMING_SNAKE_CASE__		  =				1
								for i in range(0  ,					len(__UpperCAmelCase       )       ):
												total *= numbers[i]

								SCREAMING_SNAKE_CASE__		  =				str(__UpperCAmelCase       )

								steps += 1
				return steps




def 						SCREAMING_SNAKE_CASE					(  __UpperCAmelCase       )							->   int:

				if not isinstance(__UpperCAmelCase  ,					__UpperCAmelCase       ):
								raise ValueError("additive_persistence() only accepts integral values"       )
				if num < 0:
								raise ValueError("additive_persistence() does not accept negative values"       )

				SCREAMING_SNAKE_CASE__		  =				0
				SCREAMING_SNAKE_CASE__		  =				str(__UpperCAmelCase       )

				while len(__UpperCAmelCase       ) != 1:
								SCREAMING_SNAKE_CASE__		  =				[int(__UpperCAmelCase       ) for i in num_string]

								SCREAMING_SNAKE_CASE__		  =				0
								for i in range(0  ,					len(__UpperCAmelCase       )       ):
												total += numbers[i]

								SCREAMING_SNAKE_CASE__		  =				str(__UpperCAmelCase       )

								steps += 1
				return steps


if __name__ == "__main__":
						import doctest

						doctest.testmod()




