Factorial number python
Closed
jersde
Posts
1
Registration date
Friday August 2, 2019
Status
Member
Last seen
August 2, 2019
-
Aug 2, 2019 at 07:31 PM
Lameidiot5 - Jan 3, 2020 at 10:27 AM
Lameidiot5 - Jan 3, 2020 at 10:27 AM
Related:
- Factorial number python
- Python programming language download - Download - Programming languages
- Python csvwriter - Home - Languages
- Python pycharm download - Download - IDE
- Python program to draw human face - Guide
- Samsung factory reset pin number - Guide
2 responses
kurhanskakr
Posts
4
Registration date
Monday December 23, 2019
Status
Member
Last seen
January 14, 2020
Jan 3, 2020 at 05:25 AM
Jan 3, 2020 at 05:25 AM
Why do you not reduce 'num' in the "while" cycle?
Just declare somma do not initialize it as zero. "I" is always one. You have a while statement that checks against a static variable. Get rid of the while and calculate it directly as previously stated. If "I" was an array, such as 1,3,5,7,9, then a while would be applicable, but it is not an array, it is static.