Skip to content

Commit 5c0a334

Browse files
authored
Merge pull request darkprinx#6 from harshraj22/ques2-day1
added the alternative solution to day 1 - question 2. Thank you :)
2 parents 242d1b6 + 4193f61 commit 5c0a334

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Status/Day 1.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,13 @@ print fact(x)
7676
for i in range(1,n+1):
7777
fact = fact * i
7878
print(fact)
79+
```
80+
* **Using Lambda Function**
81+
```python
82+
n = int(input())
83+
def shortFact(x): return x if x is 1 else x*shortFact(x-1)
84+
print(shortFact(n))
85+
7986
```
8087
-------------------
8188

0 commit comments

Comments
 (0)