+ 1
i want to know the answer of this program: if x is 3456
def f(x): d=0 while x >= 1: (x,d) = (x/7,d+1) return(d)
3 ответов
+ 1
"""You can run program and see output in playground..
And add calling statement and print returned result to use that function.. as
result = f(3456)
print(result)
or just
print(f(3456))
as last statements
edit:
5 as answer I got.
how?
run this script, see output """
def f(x):
d=0
while x >= 1:
(x,d) = (x/7,d+1)
print(x,",",d)
return(d)
print(f(3456))
+ 2
Thank you so much
+ 1
You're welcome..