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
def fnMod ( n ) : NEW_LINE INDENT if ( n % 5 == 1 ) : NEW_LINE INDENT return 4 NEW_LINE DEDENT else : NEW_LINE INDENT return 0 NEW_LINE DEDENT DEDENT n = 10 NEW_LINE print ( fnMod ( n ) ) NEW_LINE n = 11 NEW_LINE print ( fnMod ( n ) ) NEW_LINE