this is my first time asking question in stack,so sorry if its unclear or … my code output is supposed to be like this : enter image description here but its like this :enter image description here my code is : enter image description here thanks for any help..and again sorry if its unclear.. Source: ..

#### Category : pascals-triangle

New to learning python and am having some trouble understanding a solution provided? It has to do with Pascal Triangle and printing the rows when asking a user to "enter a row number" There were bits of the solution provided and the rest I fit in (first for loop).. n=int(input("Enter a row number: ")) a=[] ..

I’m trying write a python code that iterates over a 2-D array, the outer list should have rows in it and the inner lists should have the elements for the numbers in Pascal’s triangle. I believe I’m running into issues with initializing the lists, It’s been a while since I wrote in Python so any ..

I have created a Pascal’s triangle using list function in python.Im now looking forward to format it by including hexagons or circle patterns to each element of the Triagle .I also need to include colors such that can differentiate odd numbers and even numbers .If possible please give me some insights and guidance. Thank you. ..

I have created a Pascal’s triangle using list function in Python. I’m now looking to format it by including hexagons or circle patterns to each element of the triangle. I also need to include colors such that can differentiate odd numbers and even numbers. If possible, please give me some insights and guidance. Thank you. ..

I have created a Pascal’s triangle using list function in Python. I’m now looking to format it by including hexagons or circle patterns to each element of the triangle. I also need to include colors such that can differentiate odd numbers and even numbers. If possible, please give me some insights and guidance. Thank you. ..

I’m trying to write a function that takes an integer n as an argument and returns list of lists with the first n rows of the triangle. Example: n=1->[[1]] n=2->[[1]],[1,1]] n=3->[[1] ,[1,1] , [[ 1,2,1]] This is my code for n=3: def pascal_triangle(n): a=[] for i in range(1,n): a.append([]) a[i].append(1) for j in range(1, i): ..

## Recent Comments