Answer:
a
(would really appreciate the brainliest)
Answer:
def doMyMath(n):
if n == 1:
return n
else:
return n*doMyMath(n-1)
Explanation:
This line defines the function
def doMyMath(n):
This line checks if n is 1. If yes, it returns n (1)
if n == 1:
return n
If otherwise, it calculates the fibonacci recursively
else:
return n*doMyMath(n-1)
To call the function from main, you can use:
print(doMyMath(5))
or
num = int(input("Number: "))
--- This gets the number from user
print("Result: ",doMyMath(num)) --- This calculates the factorial
<em>This question is answered in Python</em>
Answer:
Answered below
Explanation:
public int daysSinceLastWeighed(int today)
Method is public which means it is visible to other classes. It returns an integer which is indicated as int. Next is the method's name which clearly describes what the method does 'days since last weighed'. The opening and closing parentheses enclose the integer parameter named today. This is the function header.
True, is the state of a binary 1