Hello! I am confused on the code for this question.
Write a complete Python function called Frog, with two integer parameters M and N, where N has the default value of 5. The function computes and returns one of two results: if N is odd it returns the equation 2 * M + N, but if it is even it returns the equation 3 * M - N instead.
def Frog(M,N=5): #Since N has a default value
if N%2==1: #check if N is odd or even using Modulus
return (2 * M + N)
else:
return (3 * M - N)
Frog(4)
OUTPUT
Get Answers For Free
Most questions answered within 1 hours.