DEV Community

Durga Pokharel
Durga Pokharel

Posted on

5

Day 11 of 100DaysOfCode: Python Program to find the factorial of number

This is my 11th day of #100daysofcode.

Today I learned about more properties of CSS from freecodecamp. And I also tried to write a simple python code to find factorial of number.

Python Program to Find Factorial of Number

My code is simple. At first users give integer type number. I initialized factorial as 1. There is a loop from range 1 to n + 1 and gave the condition. At last I print the factorial.

n = int(input("enter the number"))
factorial = 1
for i in range(1,n+1):
    factorial *= i

print(f"factorial of {n} = {factorial}")

Enter fullscreen mode Exit fullscreen mode

Day 11 of #100DaysOfCode and #Python
* More about CSS properties
* Python program to find factorial of number. pic.twitter.com/DWGjzJk6XC

— Durga Pokharel (@mathdurga) January 4, 2021

Jetbrains image

Build Secure, Ship Fast

Discover best practices to secure CI/CD without slowing down your pipeline.

Read more

Top comments (2)

Collapse
 
otumianempire profile image
Michael Otu

Your code is short this time. It is good. Today, you did well with the variable names...

Collapse
 
iamdurga profile image
Durga Pokharel

Yesterday I did thats much🙂

Jetbrains image

Build Secure, Ship Fast

Discover best practices to secure CI/CD without slowing down your pipeline.

Read more

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay