Insert values which are taken from the for loop
In this code I have printed these n values separately.But I want these
values to be printed in a single array after each looping.How can I do
that?
n=1000000
for x in range(1,3000001):
if n%2==0:
x=n/2
else:
x=3*n+ 1
n=x
print(n)
if n==1:
break
Thank you.
No comments:
Post a Comment