def g(x):
(q,d) = (1,0)
while q <= x:
(q,d) = (q*10,d+1)
return(d)
Answers
Answered by
2
Hi,
Your code is giving following error
Traceback (most recent call last):
File "", line 1
Def g(x):
^
SyntaxError: invalid syntax
ysony600:
poda
Answered by
0
The question is incomplete.
However,
Consider,
g(31415927)
( q, d ) = ( 1, 0 )
Condition:
q <= x
Then,
( q , d ) = ( q * 10, d + 1 )
Solution:
The loop returns a value if q > 31415927
When d = 8,
The value of q = 100000000 and so q > 31415927
Hence, the function returns 8.
Read more on Brainly.in - https://brainly.in/question/5266216
Similar questions