SlideShare a Scribd company logo
2
Most read
3
Most read
4
Most read
Created by varsha
“If this program turns out helpful to you please let me know in
the comments.”
What you should know?
Concept of factorials
If else concept
Basic knowledge of python code
Factorials: Concept
 The factorial of a positive number is the product of all
numbers less than or equal to it. So…
1! = 1
2! = 1 x 2
3! = 1 x 2 x 3
4! = 1 x 2 x 3 x 4
....
100! = 1 x 2 x 3 x 4 .... 100
Python code for factorial of a no:
Notes about code:
 “Number” is my variable for storing user’s value.
 Similarly “factorial” is also a variable
 Nested if condition is used to save time
 For condition is similar to the code in C or C++ for
factorial i.e. its easy
 In the end you get a pyramid cause computer prints all
the trials and the bottom one is the answer.
Results:

More Related Content

PPTX
Conditional Statement in C#
PDF
Python Class | Python Programming | Python Tutorial | Edureka
PPT
JavaScript Objects
PPTX
Getters_And_Setters.pptx
PPTX
Templates in c++
PPTX
Java Data Types
PDF
Lecture 3 basic syntax and semantics
Conditional Statement in C#
Python Class | Python Programming | Python Tutorial | Edureka
JavaScript Objects
Getters_And_Setters.pptx
Templates in c++
Java Data Types
Lecture 3 basic syntax and semantics

What's hot (20)

PPTX
Functions in Python
PPTX
Object Oriented Programming ppt presentation
PPTX
[OOP - Lec 18] Static Data Member
PPTX
Python oop third class
PDF
PHP Loops and PHP Forms
PDF
Python programming : Standard Input and Output
PPTX
Artificial Intelligence_ Knowledge Representation
PPT
Tsp branch and bound
PPTX
Inheritance in java
PPTX
virtual function
PPT
Files in c++ ppt
PPTX
20.3 Java encapsulation
PDF
Python If Else | If Else Statement In Python | Edureka
PDF
input/ output in java
PPTX
arrays and pointers
PPTX
Arrays in java
PPTX
Java Methods
PPTX
Applications of Linear Algebra in Computer Sciences
PPTX
Standard data-types-in-py
PPTX
Loops PHP 04
Functions in Python
Object Oriented Programming ppt presentation
[OOP - Lec 18] Static Data Member
Python oop third class
PHP Loops and PHP Forms
Python programming : Standard Input and Output
Artificial Intelligence_ Knowledge Representation
Tsp branch and bound
Inheritance in java
virtual function
Files in c++ ppt
20.3 Java encapsulation
Python If Else | If Else Statement In Python | Edureka
input/ output in java
arrays and pointers
Arrays in java
Java Methods
Applications of Linear Algebra in Computer Sciences
Standard data-types-in-py
Loops PHP 04
Ad

More from varshachhajera (20)

PPTX
Electronic spreadsheet..pptx
PPTX
Career Talk_228.pptx
PPTX
Fundamentals of computer..pptx
PPTX
history of computers.pptx
PPTX
Nature of Mathematics..pptx
PPTX
Input devices.pptx
PPTX
Output devices and types of printers.pptx
PDF
Qualities and professional comepetencies of computer science teacher.pdf
PPTX
Role of administration in inclusive school.pptx
PPTX
Co curricular activity.pptx
DOCX
SWOC analysis.docx
PPTX
Unit analsysis.pptx
PPTX
Triangles and Quadrilaterals.pptx
PPTX
Surface Area of a Right Circular Cylinder.pptx
PPTX
Software and its types.pptx
PPTX
Computer Network.pptx
PPTX
Computer Memory.pptx
PPTX
Role of Social media in Education.pptx
PPTX
Basics of HTML..pptx
PPTX
CONTEMPORARY INDIAN SCHOOLS.pptx
Electronic spreadsheet..pptx
Career Talk_228.pptx
Fundamentals of computer..pptx
history of computers.pptx
Nature of Mathematics..pptx
Input devices.pptx
Output devices and types of printers.pptx
Qualities and professional comepetencies of computer science teacher.pdf
Role of administration in inclusive school.pptx
Co curricular activity.pptx
SWOC analysis.docx
Unit analsysis.pptx
Triangles and Quadrilaterals.pptx
Surface Area of a Right Circular Cylinder.pptx
Software and its types.pptx
Computer Network.pptx
Computer Memory.pptx
Role of Social media in Education.pptx
Basics of HTML..pptx
CONTEMPORARY INDIAN SCHOOLS.pptx
Ad

Recently uploaded (20)

PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PPTX
master seminar digital applications in india
PPTX
Lesson notes of climatology university.
PPTX
Microbial diseases, their pathogenesis and prophylaxis
PDF
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
PDF
VCE English Exam - Section C Student Revision Booklet
PDF
Computing-Curriculum for Schools in Ghana
PPTX
GDM (1) (1).pptx small presentation for students
PPTX
Pharma ospi slides which help in ospi learning
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Institutional Correction lecture only . . .
PDF
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PPTX
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
PDF
FourierSeries-QuestionsWithAnswers(Part-A).pdf
PDF
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
PDF
Microbial disease of the cardiovascular and lymphatic systems
Abdominal Access Techniques with Prof. Dr. R K Mishra
STATICS OF THE RIGID BODIES Hibbelers.pdf
master seminar digital applications in india
Lesson notes of climatology university.
Microbial diseases, their pathogenesis and prophylaxis
OBE - B.A.(HON'S) IN INTERIOR ARCHITECTURE -Ar.MOHIUDDIN.pdf
VCE English Exam - Section C Student Revision Booklet
Computing-Curriculum for Schools in Ghana
GDM (1) (1).pptx small presentation for students
Pharma ospi slides which help in ospi learning
human mycosis Human fungal infections are called human mycosis..pptx
Institutional Correction lecture only . . .
A GUIDE TO GENETICS FOR UNDERGRADUATE MEDICAL STUDENTS
Chinmaya Tiranga quiz Grand Finale.pdf
Introduction-to-Literarature-and-Literary-Studies-week-Prelim-coverage.pptx
Final Presentation General Medicine 03-08-2024.pptx
Black Hat USA 2025 - Micro ICS Summit - ICS/OT Threat Landscape
FourierSeries-QuestionsWithAnswers(Part-A).pdf
3rd Neelam Sanjeevareddy Memorial Lecture.pdf
Microbial disease of the cardiovascular and lymphatic systems

Factorial of a number in python

  • 1. Created by varsha “If this program turns out helpful to you please let me know in the comments.”
  • 2. What you should know? Concept of factorials If else concept Basic knowledge of python code
  • 3. Factorials: Concept  The factorial of a positive number is the product of all numbers less than or equal to it. So… 1! = 1 2! = 1 x 2 3! = 1 x 2 x 3 4! = 1 x 2 x 3 x 4 .... 100! = 1 x 2 x 3 x 4 .... 100
  • 4. Python code for factorial of a no:
  • 5. Notes about code:  “Number” is my variable for storing user’s value.  Similarly “factorial” is also a variable  Nested if condition is used to save time  For condition is similar to the code in C or C++ for factorial i.e. its easy  In the end you get a pyramid cause computer prints all the trials and the bottom one is the answer.