human
Finding sum of digits of a number until sum becomes single digit | ''Driver program to test the above function"
How can the above be solved in Python?

Write me a code to finding sum of digits of a number until sum becomes single digit and the other steps required?
assistant
#Here is code to finding sum of digits of a number until sum becomes single digit and the other steps required.
 def digSum ( n ) :
	if ( n == 0 ) :
		return 0
	if ( n % 9 == 0 ) :
		return 9
	else :
	return ( n % 9 )
n = 9999
print ( digSum ( n ) )