Factorial in Python (Q99): Difference between revisions

From Wikibase
Jump to navigation Jump to search
‎Created a new Item: Seed (issue #6, D2): create code
 
‎Added statements for 4 properties: Seed (issue #6, D2): populate code snippet
 
Property / instance of
 
Property / instance of: code snippet / rank
 
Normal rank
Property / code source
 
factorial = lambda n: 1 if n <= 1 else n * factorial(n - 1)
Property / code source: factorial = lambda n: 1 if n <= 1 else n * factorial(n - 1) / rank
 
Normal rank
Property / programming language
 
Property / programming language: Python / rank
 
Normal rank
Property / attributed to
 
Property / attributed to: Ada Lovelace / rank
 
Normal rank

Latest revision as of 10:26, 17 August 2026

Recursive factorial function in Python (single line: Wikibase string values reject newlines)
Language Label Description Also known as
English
Factorial in Python
Recursive factorial function in Python (single line: Wikibase string values reject newlines)

    Statements

    0 references
    factorial = lambda n: 1 if n <= 1 else n * factorial(n - 1)
    0 references