Can anyone explain this Python code by Infant Ray to me in steps.
I want to make my own code that makes Pascal's triangle, but I don't know how to make it so I looked on SoloLearn to get some inspiration. I found this code but I don't understand how it works.(Functions) #function to create a pascal's triangle of size num def pascalGen(num,r=[]): for item in range(num): length = len(r) r = [1 if i == 0 or i == length else r[i-1]+r[i] for i in range(length+1)] yield r #function that draws the triangle def draw_triangle(num): pascal = list(pascalGen(num)) max = len(' '.join(map(str,pascal[-1]))) for p in pascal: print(' '.join(map(str,p)).center(max)+'\n') #enter the size of the triangle draw_triangle(int(input())) #feedback j = (35*'*') k="\nLet me know how you like the code\n" l="\n\t And\n" m="\t Leave\n" n="\t An Upvote\n" o="\t If You Like It ;)" print(j,k,l,m,n,o) Infant Ray created this code.