Computer Science, asked by divyakammela, 1 year ago

What does return for the
following function definition?
def h(x):
(m, a) = (1,0)
while m<=x:
(m,a) = (m*2,a+1)
return
(a)​

Answers

Answered by deku123123123
0

Answer:

ya

Explanation:

Answered by AskewTronics
0

It return the value of n, if the 2^{n} is greator than the x.

Explanation:

  • The above code is in python language which returns the value of n if the value of  2^{n} is greater than the x value which is passed by the user.
  • For example, if the user input is 8 then the output is 4 because 2^{4} will gives 16 which is greater than the 8 but 2^{3} will give the value 8 which is equal to the value of x variable which is also 8.
  • The above code will continue the steps until the value of 2^{n} is less or equal to the value which is input by the user. If the 2^{n} is not less than the value of x, then it returns the value of n.

Learn More:

  • Python program : https://brainly.in/question/5558161
Similar questions