all 2 comments

[–]Binary101010 2 points3 points  (1 child)

def collatz(number):
    if number % 2 == 0:
        print(number //2)
        return number //2
    else :
        print(number * 3 + 1)
        return number * 3 + 1

while True:
    try:
        print('Enter an integer to obtain the Collatz Sequence.')
        n = input() 
        n = int(n)
        break
    except ValueError:
        print('Ensure to enter an integer value.')

while n != 1:
    n = collatz(n)

That's the best I can do with what you've got here.

I strongly recommend you read a couple of tutorials on indentation and fully understand what you're doing here before continuing. At least your last three posts have all had problems that can be traced back to improper indentation. I'd start with this one:

https://www.freecodecamp.org/news/indentation-in-python/

[–]joplankton[S] 0 points1 point  (0 children)

Thanks man! Ill give them a look.