

Python Tutorial to learn Python programming with examples
Complete Python Tutorial for Beginners Playlist :
Python Tutorial in Hindi :
Github :-
Editing Monitors :
Check out our website:
Follow Telusko on Twitter:
Follow on Facebook:
Telusko :
Navin Reddy :
Follow Navin Reddy on Instagram:
Subscribe to our other channel:
Navin Reddy :
Telusko Hindi :
Donation:
PayPal Id : navinreddy20
Patreon : navinreddy20
i want to make a code for making a code language. i tried a lot but i failed every time. plss make a video on that too
def factorial(a):
for i in range(1,a):
a = a*i
print(a)
factorial(10)
length=int(input('Enter the lenght: '))
num=int(input('Numbers: '))
f=1
for i in range(1,length+1):
f=f*i
print(f)
if i == length:
print('the answer is:', f)
a=0
b=1
n=int(input('Enter how many'))
print(a)
print(b)
for i in range(n):
a+=b
b+=a
print(a)
print(b)
def fact(n): return 1 if n == 0 else n * fact(n – 1) if n > 0 else None
def tino(n):
f=1
for i in 5,2,3,4:
f=f*i
return f
x=5
result=tino(x)
print(result)
Y this code is giving an output value of 5 ?
ef fact(n):
x = n
r = 1
while x >= 1:
r*=x
x-=1
print('the result is {}'.format(r))
f = int(input('please input the value of your nummber to accont the factorial'))
fact(f)
Man, best python series.
1:00
Best Explanation and Teaching Method. Simply Awesome!!
Why do I need to specify x =4?
I mean I can directly put result = fact(4)
I gain more persistence after watching ur python videos sir tq sir…..🤝🤝
I'm little bit miserable sir bcz I did some errors in coding anything errors means coding right so no problem I practice more examples tq sir for giving such a life platform……👌👌🙏🙏
Thank you very much Sir. After watching your videos I have not any confusion
sir i had written the code properly but i'm not getting the correct output please help me with that
print("program to find factorial of numbers")
n=int(input("enter a number to find factorial "))
def fact():
i=1
f=1
while i<=n:
f=f*i
i+=1
print(f)
fact()
# FACTORIAL
def Fact(y):
f = 1 if y == 1 else y * Fact(y – 1)
return f
m = Fact(int(input("Enter a number: ")))
print("Factorial of the number is: "+str(m))
nice 👍👍👍
tried like this
def fact(n):
result=1
while n>=1:
result*=n
n-=1
return result
a= int(input("enter a positive number: "))
result= fact(a)
print("factorial of given number is: ", result)
def fact(n):
f = 1
if n == 0:
return 1
for i in range(1, n + 1):
f = i * f
return f
def fact_recursion(n):
if n == 0:
return 1
else:
return (fact_recursion(n-1) * n)
n = 10
result = fact(n)
print('Factorial of number {} is {}'.format(n, result))
result = fact_recursion(10)
print('Factorial of number {} is {}'.format(n, result))
Thank you 😊❤️
n=int(input("enter "))
k=1
for i in range(n):
k=k*n
n-=1
print(k)
buy adding if c<=n:
print c we may get the ans
Great teacher! Thank you
Amazing sir…… 👍👍
HERE IS AN EASIER CODE FOR BEGINNERS
factorial = 1
fac = int('Enter any number: ')
if fac == 0:
print('0! = 1)
else:
for x in range(1, fac + 1) :
factorial = factorial * x
print((str(fac) + '! = ') + str(factorial))
n=5
x=n-1
for i in range(1,n):
result=n*x
x=x-1
n=result
print(result)
It's simply awesome sir
All those who studied c++ know whats recursion.
HELLO SIR, I am getting issue while debugging anycode….can u please resolve my issue regarding debugging process.
If the factorial of a number is given, find the number whose factorial it is?
For eg. find the number whose factorial is 120.
How do we solve this?
In case of recursion:
x = int(input())
def factorial(n):
if n <= 1:
return 1
else:
return n * factorial(n-1)
print(factorial(x))
def fact(num):
a=1;
for i in range(1,num+1):
a=a*i
return a
num=int(input("enter the number"))
a=fact(num)
print(a)
def fac(n):
c=1
for i in range(n,1,-1):
c=c*i
print(c)
fac(5)
x=0
n=int(input("Enter the number whose fact you want to find"))
for i in range(n,1,-1):
if(i==n):
x=n
else:
n=n*i
print("Factorial is…")
print(n)
quit()
Tried something different….
this is a advice for ur channel mate, talk slower and try to wipe that english from ur lips,so u talk cleaner , no ofennce just saying , it will impruve the view
n=int(input('enter a num'))
F=1
for i in range(1,n+1):
F=F*i
print(f)
from math import *
x = int(input("Factorial of this number"))
k = factorial(x)
print("the factorial of {} is {}".format(x, k))
def fattoriale(n):
p = n
if n == 0:
return 1
else:
for i in range(1, n):
p *= i
return p
print("the factorial of {} is {}".format(x, fattoriale(x)))
#not geeting the result ??
def fact(n):
f=1
for i in range(1,n+1):
f=f*i
return f
x=5
result= fact(x)
print(result)
output:-
1
The factorial of 0 is also 1 which means we have to use if statement too
my code for finding factorial->
a=int(input("enter the number:"))
def fac(a):
b = 1
for i in range(1,a+1):
b=b*i
print(b)
fac(a)
you got great acting skills n also you have an amazing future in cinema man
this code not working
No one can beat you in teaching python thanku ❤️
def fact(n):
f=1
for i in range(1,n+1):
f=f*i
print(f)
n=int(input("Enter the number you want"))
fact(n)
n = int(input("Enter the factorial number"))
def fact(n):
f = 1
for i in range(1,n+1):
f = f * i
return f
result = fact(n)
print(result)
Hi naveen in python how to make a variable private as in java??