Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import random
- def generate_random_number():
- seed = random.random()
- count = 0
- while not seed == 1:
- if not seed % 2 == 0:
- seed = seed * 3 + 1
- else:
- seed = seed / 2
- count += 1
- final = count
- return final
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement