About 50 results
Open links in new tab
  1. Function for factorial in Python - Stack Overflow

    Feb 27, 2011 · The easiest way is to use math.factorial (available in Python 2.6 and above): import math math.factorial(1000) If you want/have to write it yourself, you can use an iterative …

  2. Python lambda function to calculate factorial of a number

    Mar 14, 2013 · I have just started learning python. I came across lambda functions. On one of the problems, the author asked to write a one liner lambda function for factorial of a number. This …

  3. Writing a Factorial function in one line in Python

    Aug 10, 2018 · Writing a Factorial function in one line in Python Asked 7 years, 1 month ago Modified 2 years, 6 months ago Viewed 7k times

  4. recursive factorial function - Stack Overflow

    How can I combine these two functions into one recursive function to have this result: factorial(6) 1! = 1 2! = 2 3! = 6 4! = 24 5! = 120 6! = 720 This is the current code for my factorial functi...

  5. Is there a math nCr function in Python? - Stack Overflow

    The denominator can be computed using factorial, which is comparable in Python 2 (slightly slower as r increases?) and much faster in Python 3.

  6. python - Factorial in numpy and scipy - Stack Overflow

    Feb 13, 2014 · How can I import factorial function from numpy and scipy separately in order to see which one is faster? I already imported factorial from python itself by import math. But, it …

  7. Write factorial with while loop python - Stack Overflow

    I am new and do not know a lot about Python. Does anybody know how you can write a factorial in a while loop? I can make it in an if / elif else statement: num = ... factorial = 1 if num < ...

  8. Factorial of a large number in python - Stack Overflow

    May 2, 2013 · 12 Factorials get very large, so it is often better to deal with logarithms of the number. Many languages have an lgamma library function which computes the natural …

  9. python - Calculate the factorial of a number - Stack Overflow

    Jul 19, 2023 · Define a function called calculate_factorial that takes in one parameter, number. Inside the function, write code to calculate the factorial of the given number. The factorial of a …

  10. Factorial Program in Python using generator - Stack Overflow

    Factorial Program in Python using generator Asked 7 years, 6 months ago Modified 1 year, 3 months ago Viewed 12k times