JoshuaBurleson 23 Posting Whiz

preferred method:

okay=False
depth=0
def dcheck():
    global depth
    global okay
    while not okay:
        try:
            depth=int(input('Enter depth in range(0,50): '))
            if depth in range(0,51):
                print(depth)
                okay=True
                return okay
            else:
                print('Invalid Depth')
                okay=False
        except:
            print('Invalid input')
    
dcheck()
TrustyTony commented: Common.... terrible code, to be honest. -3