WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions Status/Day 1.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ print(*(i for i in range(2000, 3201) if i%7 == 0 and i%5 != 0), sep=",")

### **Question:**

> **_Write a program which can compute the factorial of a given numbers.The results should be printed in a comma-separated sequence on a single line.Suppose the following input is supplied to the program: 8
> **_Write a program which can compute the factorial of a given number. Suppose the following input is supplied to the program: 8
> Then, the output should be:40320_**

---
Expand Down Expand Up @@ -93,7 +93,7 @@ print fact(x)
fact = fact * i
print(fact)
```
- **Using Lambda Function**
- **Using a Function**

```python
# Solution by: harshraj22
Expand Down Expand Up @@ -136,6 +136,20 @@ print(reduce(fun,range(1, num+1), 1))
```
---

- **Using Lambda Function and Reduce**
```python
'''Soltuion by: go1337
'''
from functools import reduce

input_nr = int(input("Enter number to get its factorial: "))

factorial = reduce(lambda x, y: x * y, range(1, input_nr + 1))
print(factorial)
```
---


# Question 3

### **Question:**
Expand Down