Python program to factorial of a number 👨‍💻 |

Опубликовано: 03 Март 2026
на канале: learn_programming_1200
63
5

In this program, we first take input from the user using the input() function and convert it to an integer using the int() function. We then initialize a variable fact to 1, which will be used to calculate the factorial.

We use a for loop to iterate over the range from 1 to the input number num+1. We multiply the variable fact by the loop variable i in each iteration and update the value of fact.

Finally, we print the result using the print() function, which includes the input number num and the calculated factorial fact.

#shorts #python #programming #coding #viral #pythontutorial #beginners #learn_programming_1200