+ 2

Factorial program in python

What is answer in a question ❓

26th Sep 2024, 1:52 PM
Deepak Royal Gold 🥇🎯💕
Deepak  Royal Gold 🥇🎯💕 - avatar
9 ответов
+ 4
If you need help, describe the issue. Do not spam solutions. Q&A is for asking programming related questions and getting help with code.
26th Sep 2024, 1:57 PM
Lisa
Lisa - avatar
26th Sep 2024, 4:02 PM
BroFar
BroFar - avatar
+ 4
print(8*7*6*5*4*3*2*1) Yes is the same as print(1*2*3*4*5*6*7*8)
26th Sep 2024, 4:15 PM
BroFar
BroFar - avatar
+ 3
WHAT is your question?
26th Sep 2024, 4:12 PM
Lisa
Lisa - avatar
+ 2
def factorial_iterative(n): result = 1 for i in range(1, n + 1): result *= i return result # Example usage num = 8 print(f"The factorial of {num} is {factorial_iterative(num)}")
26th Sep 2024, 1:53 PM
Deepak Royal Gold 🥇🎯💕
Deepak  Royal Gold 🥇🎯💕 - avatar
+ 1
Same code something change 😕
26th Sep 2024, 4:07 PM
Deepak Royal Gold 🥇🎯💕
Deepak  Royal Gold 🥇🎯💕 - avatar
0
#python code def fac(n): if n == 1: return 1 else: return n * fac(n - 1) k = int(input()) print(fac(k))
27th Sep 2024, 9:18 PM
Annihilate
Annihilate - avatar
0
#Program to factorial of a given number i = 1 fact = 1 while i < = n: fact = fact * i i + = 1 print(f "the factorial of a number {n} is {fact}")
28th Sep 2024, 12:54 AM
Koppala Likitha
Koppala Likitha - avatar
0
Hello world 🌍
21st Nov 2024, 2:55 PM
Deepak Royal Gold 🥇🎯💕
Deepak  Royal Gold 🥇🎯💕 - avatar