human
Number of substrings of a string | Python3 program to count number of substrings of a string.
driver code"
How can the above be solved in Python?

Can you provide a code to number of substrings of a string and the other steps required?
assistant
#Here is code to number of substrings of a string and the other steps required.
 def countNonEmptySubstr ( str ) :
	n = len ( str ) ;
	return int ( n * ( n + 1 ) / 2 ) ;
s = " abcde " ;
print ( countNonEmptySubstr ( s ) ) ;