human
Find the Batting Average of a batsman | Function to find the average of a batsman.
Calculate number of dismissals.
check for 0 times out.
Calculate batting average.
Driver Program"
How can the above be solved in Python?
 ... Give me a code to find the Batting Average of a batsman and the other steps required?
assistant
#Here is code to find the Batting Average of a batsman and the other steps required.
 def averageRuns ( runs , matches , notout ) :
	out = matches - notout ;
	if ( out == 0 ) :
		return - 1 ;
	avg = runs // out ;
	return avg ;
runs = 10000 ;
matches = 250 ;
notout = 50 ;
avg = averageRuns ( runs , matches , notout ) ;
if ( avg == - 1 ) :
	print ( " NA " ) ;
else :
	print ( avg ) ;