+ 2
[Challenge] Python Factorial
The factorial of a number is represented as: n! = n * (n-1) * (n-2) ... * 1 Example: 3! = 3 * 2 * 1 = 6 In 4 lines or less of Python, write a code without using any modules (your OWN code) to find the factorial of any given number. Here is my code for reference: https://code.sololearn.com/ceW6oRZBSjCE/?ref=app Good Luck!
4 ответов
+ 23
If u can accommodate Ruby...
here's Ruby 1 Liner...👇
https://code.sololearn.com/cOO78cCUdxgN/?ref=app
+ 5
https://code.sololearn.com/cb60vmKFbNLk/?ref=app
+ 3
My try:
https://code.sololearn.com/c0k034bpqK9N/?ref=app
It's 5 lines though.... 😬😬😬
EDIT: Now it's 4 lines 🙃