View the step-by-step solution to:

# def pascal(n): &quot;&quot;&quot;Prints n first lines of Pascal`s triangle author: DR#m &lt;dnpsite.narod.ru&gt; last rev 20.05&quot;&quot;&quot;...

another tutor did question 1 for me but it is not a triangle, would you mind checking it and fixing it?

thank you

def pascal(n): """Prints n first lines of Pascal`s triangle author: DR#m <dnpsite.narod.ru> last rev 20.03.05""" l=[1] p=[] for i in range(n): l2=[1] for j in range(len(l)-1): l2.append(l[j]+l[j+1]) l2.append(1) print(l) l=l2 def myfunction(): input1 = input("Input the number you want to use in the pascal Triangle: .") return int(input1) if __name__=="__main__": pascal(myfunction())

Here is the explanation for... View the full answer

def factorial(n):
r = 1
if n &gt; 0:
for i in range(1, n + 1):
r = r * i
return r
def combination(n, k):
nCk = factorial(n)/(factorial(n-k) * factorial(k))
return int(nCk)
def pascalTriangle(n):...

### Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

### -

Educational Resources
• ### -

Study Documents

Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

Browse Documents