How To Derive The Following Pattern With Python Stack Overflow

How To Derive The Following Pattern With Python Stack Overflow