Using Python compute the following:
1- Compute the sum of 1+2+…+n, when n=4
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