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 de un numero en python
- Backslash en mac - Guide
- Chipeasy v1.5.6.6 en - Download - Diagnosis and monitoring
- Anaconda python download - Download - Other
- Liste déroulante excel en anglais - Guide
- Windows 10 iso en - Download - Windows
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.