Using Python Compute Following 1 Compute Sum 1 2 N N 4 2 Compute Factorial N 1 2 N 1 N N Q37052887

Using Python compute the following:

1- Compute the sum of 1+2+…+n, when n=4

Execute 1Share main.py STDIN I.lI Result 1 #1/usr/bin/pythor n-4 sum = 0 $python main.py 10 3 5 i=1 8,while ( i <-n): sum = s

2- Compute the factorial of (n) = 1*2*…*(n-1)*n, when n=6

I done the first one please let me know if it’s correct???

I need help with number 2.

Execute 1Share main.py STDIN I.lI Result 1 #1/usr/bin/pythor n-4 sum = 0 $python main.py 10 3 5 i=1 8,while ( i <-n): sum = sum + i 10 1 12 print sum Show transcribed image text

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.