Write a Python program to finish the following tasks:
1) Ask user input a positive integer n (n > 0). If the input
integer is <= 0, ask
user input again until n > 0.
2) Use loop to calculate the factorial n! = 1 * 2 * ... * n and the
Sum = 1 + 2 +
... + n
3) Calculate and output the difference between n! and Sum, i.e. n!
- Sum.
In Python code please
Write a Python program to finish the following tasks: 1) Ask user input a positive integer n (n > 0). If the input integ
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Write a Python program to finish the following tasks: 1) Ask user input a positive integer n (n > 0). If the input integ
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!