human
Program to find sum of first n natural numbers | Returns sum of first n natural numbers.
If n is odd , ( n + 1 ) must be even.
Driver code"
How can the above be solved in Python?
 Give me a code to program to find sum of first n natural numbers and the other steps required?
assistant
#Here is code to program to find sum of first n natural numbers and the other steps required.
 def findSum ( n ) :
	if ( n % 2 == 0 ) :
		return ( n / 2 ) * ( n + 1 )
	else :
	return ( ( n + 1 ) / 2 ) * n
n = 5
print findSum ( n )