Write a program to find the factorial value of any number entered by the user.

-----Input-----

The first line contains an integer T, the total number of testcases. Then T lines follow, each line contains an integer N. 

-----Output-----
For each test case, display the factorial of the given number N in a new line.

-----Constraints-----
- 1 ≤ T ≤ 1000
- 0 ≤ N ≤ 20

-----Example-----
Input
3 
3 
4
5

Output

6
24
120

Difficulty: interview

Starter code:

Solutions:
# cook your dish here
x=int(input())
for i in range(x):
    s=int(input())
    fact=1
    for i in range(1,s+1):
        fact=fact*i
    print(fact)


# cook your dish here
for _ in range(int(input())):
    n= int(input())
    fact=1
    if n==0:
        pass
    else:
        for i in range(1, n+1):
            fact*=i
    print(fact)

t=int(input())
for i in range(1,t+1):
    t=t-1
    fact=1
    n=int(input())
    for i in range(1,n+1,+1):
        fact=fact*i
    print(fact)


import math
t=int(input())
for i in range(t):
    n=int(input())
    print(math.factorial(n))


n=int(input())
for i in range(n):
    x=int(input())
    f=1 
    j=1 
    while j<=x:
        f*=j 
        j+=1 
    print(f)


# cook your dish here
import math
n = int(input())
print()
while n>0:
    x = int(input())
    print(math.factorial(x))
    n = n-1

for _ in range (int(input())):
    n = int(input())
    fact = 1
    if n==1:
        print(1)
    else:
        for i in range (n,1,-1):
            fact *= i 
        print(fact)


# cook your dish here
import math
for _ in range(int(input())):
    n=int(input())
    print(math.factorial(n))

# cook your dish here
try:
    t=int(input())
  
    for i in range(0,t):
        n=int(input())
        fact=1
       
        while(n!=0):
            fact=fact*n
            n-=1
        print(fact)
except:
    pass

# cook your dish here
import math
x=int(input())
for i in range(x):
    print(math.factorial(int(input())))


# cook your dish here
import math
for _ in range(int(input())):
    print(math.factorial(int(input())))


# cook your dish here
t = int(input())
fact = [1,1]
for i in range(2,21):
    fact.append(i * fact[i - 1])
for i in range(t):
    n = int(input())
    print(fact[n])

import math
for t in range(int(input())):
    n=int(input())
    print(math.factorial(n))

def factorial(N):
    if (N == 1 or N == 0):
        return 1
    else:
        return N*factorial(N-1)
T = int(input())
for i in range(T):
    N = int(input())
    print(factorial(N))

#Note that it's python3 Code. Here, we are using input() instead of raw_input().
#You can check on your local machine the version of python by typing "python --version" in the terminal.

#Read the number of test cases.
import math
def facto(n):
    return math.factorial(n)
    
t=int(input())
while t:
    t = t - 1
    n=int(input())
    print(facto(n))


# cook your dish here
t = int(input())
#res =1
for _ in range(t):
    n = int(input())
    res = 1
    for i in range(1,n+1):
        res *= i
    print(res)


def fact(a):
    if(a==1 or a==0):
        return 1
    else:
        return a*fact(a-1)
t=int(input())
for i in range(t):
    a=int(input())
    ans=fact(a)
    print(ans)



t=int(input())
for i in range(t):
    n=int(input())
    fact=1
    while(n!=0):
        fact=fact*n
        n=n-1
    print(fact)

T = int(input())

for i in range(T):
    N = int(input())
    Number = 1
    for l in range(1,N+1):
        Number*=l
    print(Number)


T = int(input())

for i in range(T):
    N = int(input())
    Number = 1
    for l in range(1,N+1):
        Number = Number * l
    print(Number)


T = int(input())

for i in range(T):
    N = int(input())
    Number = ""
    for l in range(1,N+1):
        Number+=str(l)
    Multiply = 1
    for j in range(len(Number)):
        Multiply = Multiply * int(Number[j])
    print(Multiply)

import math
N=int(input())
for _ in range(N):
    print(math.factorial(int(input())))

# cook your dish here
import math
for _ in range(int(input())):
    print(math.factorial(int(input())))

import math
t=int(input())
i=0
while i<t:
    n=int(input())
    print(math.factorial(n))
    i+=1

# cook your dish here
import math
for _ in range(int(input())):
    print(math.factorial(int(input())))