human
Find value of ( n ^ 1 + n ^ 2 + n ^ 3 + n ^ 4 ) mod 5 for given n | Function for f ( n ) mod 5.
if n % 5 == 1 return 4.
else return 0.
Driver Code"
How can the above be solved in Python?
assistant
#Here is code to find value of ( n ^ 1 + n ^ 2 + n ^ 3 + n ^ 4 ) mod 5 for given n and the other steps required.
 def fnMod ( n ) :
	if ( n % 5 == 1 ) :
		return 4
	else :
		return 0
n = 10
print ( fnMod ( n ) )
n = 11
print ( fnMod ( n ) )