Steps

in ita •  23 days ago 

def steps(n):
if n <= 0 : raise ValueError("Only positive integers are allowed")
if n==1: return 0
n= n/2 if n%2==0 else n*3+1
return 1 + steps(n)

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Thank you, friend!
I'm @steem.history, who is steem witness.
Thank you for witnessvoting for me.
image.png
please click it!
image.png
(Go to https://steemit.com/~witnesses and type fbslo at the bottom of the page)

The weight is reduced because of the lack of Voting Power. If you vote for me as a witness, you can get my little vote.