Python Programs - Factorial Program Using for loop

  Рет қаралды 143,031

Amulya's Academy

Amulya's Academy

Күн бұрын

Пікірлер: 224
@algo3an
@algo3an 3 жыл бұрын
finally, someone explains it in details. I struggled a lot trying to understand it. Keep up the good work
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Thank you :)
@Ayasir-lo3ir
@Ayasir-lo3ir 3 жыл бұрын
it's simple it goes back to for loop when the there is no more list it will return the list
@supriyasuppu8388
@supriyasuppu8388 3 жыл бұрын
Hlo explain how find given number s factorial or not Example 24=4!
@YDM16
@YDM16 2 жыл бұрын
Same here💯💯
@sunitagupta5864
@sunitagupta5864 Жыл бұрын
Hh
@chennaramana9893
@chennaramana9893 6 жыл бұрын
I don't know your age but the way you teaching was with full of clarity and even non IT can also learn this python through your teaching but my request make some videos about complex programs of using combinations of if, for , while and also tkinter kindly
@AmulsAcademy
@AmulsAcademy 6 жыл бұрын
Sure:)
@libinvarghese2886
@libinvarghese2886 2 жыл бұрын
Thank you ma'am.. this explanation is truly a gem. I was trying to learn this for a week.
@srishtinisha1712
@srishtinisha1712 Жыл бұрын
I came here after watching so many videos which goes over my head.. finally the way you explain in detail clear my concept.. thank you so much 🙏
@omkar1592
@omkar1592 3 жыл бұрын
Thanks Amulya for this amazing explanation!!!
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Pleasure 😊❤️
@chidij20
@chidij20 Жыл бұрын
You are definitely a good teacher 👏🏽👏🏽👏🏽👏🏽I need more classes so I had to follow you
@krishk4870
@krishk4870 5 жыл бұрын
Neat Yar amul baby😊😘 loved it
@Krishhh.....
@Krishhh..... 2 жыл бұрын
You at the best python teacher
@garammasala9886
@garammasala9886 3 жыл бұрын
I was trying to understand from previous two days to understand in detail, finally my search is over and got a perfect explanation. Big THANK YOU : )
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Pleasure 😊
@nurfatinnazurah296
@nurfatinnazurah296 3 жыл бұрын
Thanks, i was just struggle answering my question and after i found this, i'm now ok with it.
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Glad to hear that 😊
@nurfatinnazurah296
@nurfatinnazurah296 3 жыл бұрын
@@AmulsAcademy tq😁
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
😊
@dineshkumar-bi7my
@dineshkumar-bi7my 3 жыл бұрын
Awesome, Thank you. Now my doubt was cleared after saw your video :)
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Glad to hear that :)
@mokimanik8721
@mokimanik8721 Жыл бұрын
Wonderful teaching ✨🙏 but I saw one of the they mentioned num+1 in range like num=7 f=1 For i in range(1, num+1): f=f*1 Print (f)
@prakhyathmunna254
@prakhyathmunna254 13 күн бұрын
Simple and effective explanation mam ❤
@AmulsAcademy
@AmulsAcademy 13 күн бұрын
Glad you liked it :)
@sathya_krish
@sathya_krish 3 жыл бұрын
Thank you So Much😄 You have Great Teaching Skill😇
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Thank you! 😃
@rajathilak3083
@rajathilak3083 4 жыл бұрын
Hello Amulya, I have doubt, num=0 result=1 if i in range(num,0,-1): #(0,0,-1)#i=0 result=result*i #1=1*0=0 print (result) #ans=0#how it get output 1 Can you clarify me above concept for given input as 0 Thanks in advance
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
if i in range(num,0,-1): #(0,0,-1)#i=0 I think it is not if , you are using for loop. and when range() starts from 0 and ends 0 it won't take i as 0, actually it won't give any value because end value is exclusive. So it won't execute for loop body. it will print the result, that's why you will get result as 1. if you want result as 1 then you can write like this: for i in range(num,-1,-1): #(0,-1,-1)#i=0
@rajathilak3083
@rajathilak3083 4 жыл бұрын
@@AmulsAcademy Thank you :)
@agamsaraswat5296
@agamsaraswat5296 2 жыл бұрын
explanations of the exact happenings in for loop helped us understand this function
@vishaltiwaribnt
@vishaltiwaribnt 2 жыл бұрын
step by step clearly explain.....thnks u
@sabyasachidas4572
@sabyasachidas4572 2 жыл бұрын
I've just learned the basics of python and im solving some basic questions. Can you tell me shall start learning dsa or I should wait and solve more python problems to start it🤔 Please reply it will be very helpful to me.
@ashleyjones193
@ashleyjones193 2 жыл бұрын
Excellent explanation this question asked in capgemini interview
@ranjanrana8227
@ranjanrana8227 2 жыл бұрын
Thanks a lot maam…….. I finally understood the full logic
@ANTDOG123
@ANTDOG123 5 жыл бұрын
Thank you so much for your help and knowledge on the subject. I was really struggling.
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
My Pleasure :)
@muhammedilliyas7261
@muhammedilliyas7261 4 жыл бұрын
Really you are a great teacher/trainer. thank you so much. if you conducting a learning institution please let me know.
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Thank you, I will :)
@mohamedhasan5259
@mohamedhasan5259 3 жыл бұрын
finally i have got my computer science tutor
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Welcome :)
@sumitjha3033
@sumitjha3033 3 жыл бұрын
thank you you explained it in the best way
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Glad to hear that 😊
@venkataramanabanda8105
@venkataramanabanda8105 3 жыл бұрын
If take n = 0 then what will happens..how works plz tell me...0*1=0
@dhineshdhini8416
@dhineshdhini8416 5 жыл бұрын
1st thank u for ur video its simple nd easy to understand can you make a factorial program using while loop
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
This may help you: num = int(input("enter the number: ")) res = 1 i = 1 while i
@infinity4037
@infinity4037 2 жыл бұрын
Your explanation is awesome.
@nevaehortiz8210
@nevaehortiz8210 2 жыл бұрын
Hey, I love the video and I now understand it better but do you know how to make it so it only gives a factorial of numbers in a set range?? I need it to be between 1 and 25 but I don't know how to get the range set without it running through every single number, thank you for any help :] have a good day
@maheshkumarinfo9806
@maheshkumarinfo9806 2 жыл бұрын
Tq for your beautiful explanation❤
@nagendra9853
@nagendra9853 3 жыл бұрын
Really awesome explained it's easy to understand please upload full python tutorial pin to pin explain 🤗
@ambreshmeti8025
@ambreshmeti8025 2 жыл бұрын
Super explanation kya kaa
@AslamAslam-bh7sy
@AslamAslam-bh7sy Жыл бұрын
Very good explain,, thank u so much,.. ❤
@vidhijaiswal5605
@vidhijaiswal5605 3 жыл бұрын
Thank you for your help
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Pleasure :)
@jacobmathews862
@jacobmathews862 4 жыл бұрын
Mam can do Qns like write a menu driven program to print truth table of following logic gates AND,OR,NOT
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
I will try :)
@raravindh8808
@raravindh8808 2 жыл бұрын
Thank you mam
@anuragmu2925
@anuragmu2925 7 ай бұрын
And when we have to print like 5×4×3×2×1=120 what we have to do
@eshwarb1115
@eshwarb1115 3 жыл бұрын
I'm getting 1as output for factorial of 5 what to do
@Selvi574
@Selvi574 5 жыл бұрын
Very helpful mam
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
Thank you :)
@soumyasinha4183
@soumyasinha4183 4 жыл бұрын
Here we can take range as (1,n+1)?
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Yes You can :)
@gajjadatinku5700
@gajjadatinku5700 3 жыл бұрын
Why zero is taken range function, in this program, how it is used.
@shafeeqahmed7019
@shafeeqahmed7019 21 күн бұрын
Mam what if n=0 in this case?
@manasibhoir3988
@manasibhoir3988 4 жыл бұрын
Very good explanation 👍👌
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Thank you :)
@s2613
@s2613 5 жыл бұрын
Why did you take result=1 ? Could please tell me Amulya
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
Because to get factorial of number we need to do multiplication. result is the variable which will hold my final result. If i take 0 , 0 multiply anything will be 0, that's why i took 1. value 1 won't change any output, because if you multiply any value with 1 answer remains same :)
@s2613
@s2613 5 жыл бұрын
Amuls Academy Thank you so much Amulya 😊 You are really doing great job 😊
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
Thank you :)
@sudiptachakraborty745
@sudiptachakraborty745 6 жыл бұрын
You are doing a fantastic job. Keep it up.
@AmulsAcademy
@AmulsAcademy 6 жыл бұрын
Thank you:)
@krishnakantmishra9168
@krishnakantmishra9168 4 жыл бұрын
Ma'am in my PC it shows errror in the 2nd line
@algo3an
@algo3an 3 жыл бұрын
Double check your indentation. It could be the issue. Plus what error message are you getting?
@ilzz9856
@ilzz9856 4 жыл бұрын
Like ur teaching 🔥🔥🔥
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Glad to hear that :)
@MRPJ-ty3ps
@MRPJ-ty3ps 4 жыл бұрын
thank you so much u saved me i was unable to understand this program
@dfgndfghdfghdfgh
@dfgndfghdfghdfgh 4 жыл бұрын
so helpful
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Glad it was helpful!
@sojibakash
@sojibakash 2 жыл бұрын
If we provide input=0,, result=1*0,, so it print output 0., but 0 factorial =1..how it??
@ishaan3475
@ishaan3475 Жыл бұрын
Thank you so much🙏
@ramakantpandit7151
@ramakantpandit7151 2 жыл бұрын
The helps me alot
@lakshmansai4172
@lakshmansai4172 4 жыл бұрын
Madam why we used the -1 in for loop
@haarishp4913
@haarishp4913 3 жыл бұрын
Your voice is nice
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Thank you :)
@DeepakKumar-xu6kg
@DeepakKumar-xu6kg 4 жыл бұрын
Really, very helpful channel and the explanation and content is awesome....😊👍
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Thanks a lot 😊
@umarhasnain7369
@umarhasnain7369 4 жыл бұрын
Great explanations. I was looking for it
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Glad it was helpful! :)
@THUSxFAR
@THUSxFAR 4 жыл бұрын
Great video
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Thank you :)
@asiachannel2826
@asiachannel2826 3 жыл бұрын
Really mam your voice is very beautiful like cackoo
@briankwala7923
@briankwala7923 Жыл бұрын
thank you
@Turtle_Tutor
@Turtle_Tutor 3 жыл бұрын
Can you tell me what is done if we write result =2 and why we use result function ??~_~
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Give me the program please :)
@JWandy-us3bn
@JWandy-us3bn 5 жыл бұрын
Thank u soooo much Can I write (-1,-n-1,-1)... In for loop
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
yes you can :) n=10 for i in range(-1,-n-1,-1): print(i) :)
@abishaa6691
@abishaa6691 2 жыл бұрын
understandable 👌
@praanadhyarlagadda6413
@praanadhyarlagadda6413 Жыл бұрын
thanks
@radhakrishna.kalluri7192
@radhakrishna.kalluri7192 2 жыл бұрын
The Best
@mdfaizan2152
@mdfaizan2152 5 жыл бұрын
it is simple bt i was unable to understand this clearly for i in range(number,0,-1): but instead of ths i used for i in range(1,number+1):
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
for i in range(number,0,-1): Here i value will be in descending order. if number is 5 then , i value will be 5 4 3 2 1 for i in range(1,number+1): here i value will be in ascending order starting from 1. if number is 5 then i value will be 1 2 3 4 5 :)
@SupGhostly
@SupGhostly 5 жыл бұрын
the goal is to count down from n. So range (n, 0, -1) means: start at the n value ( n =5 ) go to 0, from the starting point of n value - go down by 1 ( thus -1)
@diagonalgaming1704
@diagonalgaming1704 2 жыл бұрын
why is result=1?
@rafaykhattak4470
@rafaykhattak4470 Жыл бұрын
thank u
@aj0035
@aj0035 4 жыл бұрын
Thank You Honestly ❤
@vijaykavuri
@vijaykavuri 5 жыл бұрын
I am able to get the program to display the answer, however I need it to also display the actual calculation, for example if the user enters 4 I need it to display as: 4! = 1 x 2 x 3 x 4 = 24 any help on how to add this in to the code?? Thanks in advance!
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
def recur_factorial(n): if n == 1: print(n,"=",end=" ") return n else: print(n,"*",end=" ") return n*recur_factorial(n-1) n = int(input(":")) print(recur_factorial(n)) :)
@priyankapanwar5377
@priyankapanwar5377 3 жыл бұрын
enter the number:3 factorial of 3 is 3 factorial of 3 is 6 factorial of 3 is 6 I am getting output like this
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Give me the program 😊
@dhananjaymudgule
@dhananjaymudgule 3 жыл бұрын
nice
@aniljain5094
@aniljain5094 5 жыл бұрын
Can u make this program using while loop.
@JonnyGall
@JonnyGall 4 жыл бұрын
n = int(input("Enter the number: ")) result = 1 while i > 0: result = result * i i = i - 1 print("Factorial of",n,"is",result)
@santhosh3374
@santhosh3374 6 жыл бұрын
can't it be 1x2x3x4x5? or only 5x4x3x2x1
@AmulsAcademy
@AmulsAcademy 6 жыл бұрын
Factorial of a positive integer n is the product of all positive integer less than equal to n. 1x2x3x4x5 = 120 5x4x3x2x1 = 120 the way of arranging is different thats it:) I think we write in decreasing order because of the formula. n! = n*(n-1)! :)
@prabhashthakur2702
@prabhashthakur2702 6 жыл бұрын
great didi
@AmulsAcademy
@AmulsAcademy 6 жыл бұрын
Thank you:)
@sivasharma7192
@sivasharma7192 4 жыл бұрын
def fact(x,fact=1): while x>0: fact=fact*x x=x-1 return fact
@Evil_2004
@Evil_2004 4 жыл бұрын
👍
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Thank you :)
@jawadamir9282
@jawadamir9282 5 жыл бұрын
so sweet voice
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
Thank you :)
@hemantsinghkushwah
@hemantsinghkushwah 4 жыл бұрын
Great Job ! thanks forever : #eartherk07
@krib1669
@krib1669 5 жыл бұрын
How to find the factorial of a float(), typecasting to int() makes it loose it properties as a float
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
You can use gamma function :)
@krib1669
@krib1669 5 жыл бұрын
@@AmulsAcademy Is there any other way without using functions.
@venkateshvenkat5335
@venkateshvenkat5335 2 жыл бұрын
N,0,-1andhuku vaduthamu
@sonamnaik2804
@sonamnaik2804 4 жыл бұрын
tysm....♥️
@poojabharti6520
@poojabharti6520 5 жыл бұрын
n = int(input("enter the number: ")) result = 1 i = 1 for i in range(n,0,-1): result = result * i i = i + 1 print("factorial of ", n, " is ", result)
@bhashkarrawat1829
@bhashkarrawat1829 5 жыл бұрын
But the results will be 1always
@AmulsAcademy
@AmulsAcademy 5 жыл бұрын
Why ? Give me the program please :)
@steepenrajd15
@steepenrajd15 Жыл бұрын
Explain n=0
@asiachannel2826
@asiachannel2826 3 жыл бұрын
I want to make you friend, are you ready. Don't forget to reply
@jaiminsolanki8258
@jaiminsolanki8258 4 жыл бұрын
Beauti voice
@greeshmashetty1724
@greeshmashetty1724 3 жыл бұрын
Amulya a kind request - can you also please start making videos for javascript programme along with python. Javascript is also widely used and I am sure lot of people out there are looking for programming way of explaining just like you do in python. I will be so greatful for you if you can start javascript tutorial and programs as well. Thank you very much. ❤️
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
I will try :)
@acousticbro4448
@acousticbro4448 3 жыл бұрын
Bro sorry but you speak "n" like "yen". The right pronunciation is "en" not yen
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Thank you :)
@santhoshking2590
@santhoshking2590 3 жыл бұрын
Your voice is...beautiful... 😅
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Thank you 😊
@vishallodhi5416
@vishallodhi5416 4 жыл бұрын
You are doing great job
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Thank you so much 😀
@vishallodhi5416
@vishallodhi5416 4 жыл бұрын
Thanks
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Welcome :)
@enough_4_you680
@enough_4_you680 3 жыл бұрын
Thnkuuuuu sooo much....... 🐨🐨
@paviyug
@paviyug 4 жыл бұрын
Your explanation is very clear. Thank you so much
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Glad it was helpful!
@francescowang
@francescowang 3 жыл бұрын
n = 5 result= 1 for i in range(n, 0, -1): result *= i print('the factorial of', n, 'is', result) alternative method: n = 5 result= 1 for i in range(1, n + 1): result *= i print('the factorial of', n, 'is', result) Why does (n, 0, -1) work the way it does? I find (1, n + 1) slightly easier to understand. It begins at 1, then to stop the loop you do n+1. Fantastic video btw. Please keep making them. You are brilliant. I just subscribed.
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
range(n,0,-1) will give output 5 4 3 2 1 😊
@iamchaos9144
@iamchaos9144 3 жыл бұрын
@@AmulsAcademy how can I print for example 1×2×3×4=24
@manikandand2541
@manikandand2541 4 жыл бұрын
hiii mam i am came again shall i say one thing....every program...in python...i will search like.....the program name with amul acedemy in youtube search....lv u mam...u r like mentor
@AmulsAcademy
@AmulsAcademy 4 жыл бұрын
Thank you so much :)
@sohailkazi5901
@sohailkazi5901 5 жыл бұрын
Thank you!
@AdamGiaIsMetal
@AdamGiaIsMetal 4 жыл бұрын
You are THE best python teacher on YT. Thanks from New York!
@kumkumslab5811
@kumkumslab5811 3 жыл бұрын
Nice explaination mam after a long time i got your channel
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Welcome :)
@vishal_sharma_2006
@vishal_sharma_2006 3 жыл бұрын
Amulya u are on the next level girl u explain so easily . Keep growing
@AmulsAcademy
@AmulsAcademy 3 жыл бұрын
Thank you so much :)
@smehta2668
@smehta2668 6 ай бұрын
i'm confusing from last one year i have completed my data science course but programming concept is not clear yet. Now my searching is over i'll not miss any videos please upload some more videos for python.
@asfarhatehanoor2163
@asfarhatehanoor2163 2 жыл бұрын
Thank you very much madam🙏🙏🙏your way of explanation is very nice.... .madam
Python Tutorial - Fibonacci Series
13:49
Amulya's Academy
Рет қаралды 186 М.
Solve any Star Pattern program in Python
18:44
Simply Coding
Рет қаралды 963 М.
WORLD BEST MAGIC SECRETS
00:50
MasomkaMagic
Рет қаралды 53 МЛН
Apple peeling hack @scottsreality
00:37
_vector_
Рет қаралды 132 МЛН
Python Programs - Factorial Program Using Recursion
18:08
Amulya's Academy
Рет қаралды 74 М.
Please Master These 10 Python Functions…
22:17
Tech With Tim
Рет қаралды 163 М.
Program Factorial in Python (Tutorial) | Python for Math
7:24
Wrath of Math
Рет қаралды 37 М.
25 nooby Python habits you need to ditch
9:12
mCoding
Рет қаралды 1,8 МЛН
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 309 М.
Python 101: Learn the 5 Must-Know Concepts
20:00
Tech With Tim
Рет қаралды 1,2 МЛН
Number Pattern | Part 1 | Python Pattern Programs
24:08
Amulya's Academy
Рет қаралды 386 М.
why are switch statements so HECKIN fast?
11:03
Low Level
Рет қаралды 410 М.
Enums Explained In Under 12 Minutes In Python
12:03
Indently
Рет қаралды 21 М.