What does h(3231) return for the following function definition?
def h(x):
(m,a) = (1,0)
while m <= x:
(m,a) = (m*2,a+1)
return(a)
by using python
Answers
Answered by
0
Explanation:
it is the answer so it is the answer as it is the answer that's why it's the answer finally it's only the answer
it is the answer so it is the answer as it is the answer that's why it's the answer finally it's only the answer
Answered by
2
The above code return 12 for the value of h(3231).
Explanation:
- The above code is in python language which returns the value of n if the is greater than the x value which is taken by the function "h" as an argument.
- The above code continues the process until the value of is less than or equal to the value of x, but if the value of is greater than the value of x. Then the value of n is returned.
- For example if the user pass 3231 for the x variable then it returns 12 because is greater than 3231, but the value of is less than 3231
Learn More:
- Python program : https://brainly.in/question/5558161
Similar questions