Sir..I want to say something. I watched several videos on UA-cam but I didn't understand from any videos.. suddenly I got ur video Its really surprised for me because it's really amazing the way of teaching 👌😊.. right now my each and every concept becomes clear..I appreciate your efforts and ur knowledge... THANK YOU ❤️ SIR
Dear All, Please refer this video only for checking a 3 digit number is Armstrong or not. For any number of digits refer this program: ua-cam.com/video/0uRtnZXMfqM/v-deo.html
before i found your video i had to look for many videos yet difficult to understand but when i started looking yours i understand it and saved a lot of time.thankyou
Sir, maine saal ke beech mein cs li hai, scul mein kuch samajh nhi aa rha tha, yt par bhatakte aapke channel par aaya seriously aap boht acche se samjhaate ho, ab sab ho jaata hai All thanks to u sir😄😊
If I enter 1634, it is also an armstrong number. But if I run with your code than it will execute it is not an armstrong number. So, what to do in such case? Should I use the concept the exponentials? Anyways, love your video. Edit: So, I came up with this idea. num = int(input("Enter a number: ")) # initialize RESULT RESULT = 0 # changing num to string to find the length bcoz you cannot find the length of integer. power= len(str(num)) # find the sum of the cube of each digit temp = num # num value should be greater than 0 while temp > 0: digit = temp % 10 RESULT += digit ** power temp //= 10 # display the result if num == RESULT: print(num,"is an Armstrong number") else: print(num,"is not an Armstrong number") # So, this would work perfectly fine. Not copied ok!!!
Hello Subrat, I am also confused that why my code is not working. However, the way you suggested is Good. You can proceed with that. I am just trying to find out the loop hole as to why my code fails the this instance.
@@codeitup I also stucked in the same question thanks subrat for the solution and the problem is that i think for 3 digit ex.153=1*1*1+5*5*5+3*3*3 is correct but when it comes to 4 digit number we have to find it like this 1634=1*1*1*1+6*6*6*6+3*3*3*3+4*4*4*4 but in the video it is sum=sum+(i%10) *(i%10) *(i%10) so it work for only for 3 digit.This is the reason its not working .Btw thank you sir for your videos it is helpful
Sir best series of python. Any one who is finding it hard to learn python can learn with codeitup because of the best explanation. Plus he teaches us with a lot of examples. BTW sir I have a suggestion that it would be better if you teach us with games also.....
Sir armstrong number is not only used for doing cube of any number it is used for doing the power of the total number of digits available in original number For example, abcd= (4*pow(a))+(4*pow(b))+(4*pow(c))+(4*pow(d)) Here there are four digits in abcd number then it is used as 4 power of all the elements of abcd number
Another alternative method to calculate the Armstrong Number: ### Get the number n = int(input("Enter the number: ")) ### Convert to string n1 = str(n) ### String Count count = len(n1) ### add string to list n1 = [int(i) for i in n1] ### find the power of each number by its count and store in D list D = [ ] for i in n1: j = i ** count D.append(j)
### Initiate the dummy variable for the addition of list sums = 0 for num in D: sums += num
### Driver function to check the number is Armstrong or not. if n == sums: print("Its Armstrong Number.") else: print("Not an Armstrong number.")
Code explanation was good .... but, how did u figure out what to write inside the while loop... how do we crack it , or do we need to remember that fourmla.... ????????
I think you watched this program directly. If you will see the programs I have uploaded just before this, you will know the concept how to figure out the logic for this program.. All my videos are step by step. See the video just before it i.e. tutorial 22 and 23 and you will understand how to figure out the logic.
Thanks for superb explanation. Sir, the above code is for 3 digit number separately and we can write it for 4 digit number also separately(sum=sum+(i%10)**4). But, How to write a single code to check whether a number is Armstrong or not for any digit?
Hi please consider easiest way: n1=input("Enter the number :") c1=[int(e) **len(n1) for e in n1] c2=(sum(c1)) If str(c2) ==n1: print ("its a Armstrong number") else: print ("Not a Armstrong number")
Sir can you please tell me how to study computer science in class 11 😭😭😭 And also I don't know any basics but unfortunately I had taken cs in class 11..
i = int(input("enter the number:")) n = len(str(i)) orig = i sum = 0 while i>0: sum = sum + pow(i%10,n) i = i//10 if orig == sum: print("Its an armstrong number") else: print("itz not an armstrong number")
Sir I have a doubt in this program, Sir when I run this program and enter 3 digits Armstrong no, it show number is Armstrong but when I enter 4 digit Armstrong number it shows that the number is not Armstrong... I request you to plzz solve my doubt
Sir can i write the program like this i=int(input("enter number to check for Armstrong:")) orig=i j=i sum=0 count=0 while(i>0): i=i//10 count=count+1 while(j>0): sum=sum+(j%10)**count j=j//10 if orig==sum: print("Number is Armstrong") else: print("Number is not Armstrong")
Not a stupid question. Question is always a question Rabiraj. = is used to transfer values viz a=3, b=6 == is used to check whether two values are equal or not. So, = & == both are completely different.
Rs 159/- is just for supporting codeitup in which you may ask you question in comment box and you will definitely get a reply. But Rs 799/- is the most impressive one in which you will get my contact number and you can ask questions directly to me. Even, you can have one to one doubt clearing session once in a month.
if we write 1634 this is also armstrong number but its coming wrong acording to your code pleace make me understand this for only 3 digit if we write for digit of arm strong then anser is not coming
Sir..I want to say something. I watched several videos on UA-cam but I didn't understand from any videos.. suddenly I got ur video Its really surprised for me because it's really amazing the way of teaching 👌😊.. right now my each and every concept becomes clear..I appreciate your efforts and ur knowledge... THANK YOU ❤️ SIR
Thanks a ton Shahid for such a nice comment. Kindly share this channel with your friends.
@@codeitup sure sir ❤️
Code Harry ka baap
Right 😊
Dear All, Please refer this video only for checking a 3 digit number is Armstrong or not. For any number of digits refer this program: ua-cam.com/video/0uRtnZXMfqM/v-deo.html
Logic was so simple to understand. I'm from non IT background and your channel is perfect for understanding the basic.
Thanks Sundeep
before i found your video i had to look for many videos yet difficult to understand but when i started looking yours i understand it and saved a lot of time.thankyou
Glad it helped Niva !
You're the best teacher of computer science!
Thankyou very very much sir!
Thanks and welcome!
Sir you are great the way you explain coding with example is totally amazing and easy to understand
I am so greatful to be your online student❤☺
Thanks Riya Kandpal. Keep Learning and Supporting :)
THANK YOU SIR. You and Your teaching is unique and excellent.
Thanks & most welcome Suraj!
right sir you are amazinggggggggggggggggggggg
Best videos in the you tube for beginners
😊
Your teaching skill is exceptionally phenomenal❤❤
Jese Apne Smjhaya H... koi baccha Bhi smjh Jaye ga, ❤️❤️❤️❤️👌👌👌👌 nice guruji
Thanks Dear !
Thanks sir you give with best teaching way I like your way love and thanks Allah pak apko mazeed kamyab kary AMeen
So nice of you🙏
Your explanation is crystal clear sir
Thanks😊
Thanks bro. My Python Exam in tomorrow. I leaved class from 13 days .but I watch your video and practice in home. Thanks bro thanks bro
Most welcome 😊
Your explanation is awesome sir
Thanks😊
I will definitely share your videos with my friends.
Thanks Suraj😊
The way you teach everyone will learn sir.
I just try to make videos as simple as possible. Keep supporting, keep learning.
Awesome videos sir... They are really helpful... Very nice
Glad to help you Deeksha!
Sir the way u teach is very awesome I'm doing MCA & python is there in my syllabus & it's really great to learn from your UA-cam video.
🙂👍
Sir really you are awesome so nicely explained.
Love u sir ji
My pleasure Yash, keep learning!
Perfectly Explained , I understood totally ,Thank you sir... I like the way you teach,always from basic...
Thanks & most welcome Abhishek 😊
Sir, maine saal ke beech mein cs li hai, scul mein kuch samajh nhi aa rha tha, yt par bhatakte aapke channel par aaya seriously aap boht acche se samjhaate ho, ab sab ho jaata hai
All thanks to u sir😄😊
Thanks tushar ! Keep Learning and support this channel to grow. Please share this channel with all you friends.
@@codeitup sure , sir
@@tusharkumar1783 Thanks Tushar !
Sir aap bahut achhe se samjhate h thank you
Thanks & most welcome Puja!
Nice explanation..!!!
But this program is for 3-digit numbers only.
Bahut hi useful video..👌
Sir apki video sirf 360 pe hi chalti hai 240 pe nahi aisa kyun ?
Too much simplicity in u'r video's.. Really I like it.. 🙌
Thanks Pratibha!
thank you very much sir. helped me a lot one week before the practical exam
You are most welcome!
The way yoy teach is amazing sir👍
Thanks Meena, help this channel to grow. Keep learning keep supporting!
If I enter 1634, it is also an armstrong number. But if I run with your code than it will execute it is not an armstrong number. So, what to do in such case? Should I use the concept the exponentials? Anyways, love your video. Edit: So, I came up with this idea.
num = int(input("Enter a number: "))
# initialize RESULT
RESULT = 0
# changing num to string to find the length bcoz you cannot find the length of integer.
power= len(str(num))
# find the sum of the cube of each digit
temp = num
# num value should be greater than 0
while temp > 0:
digit = temp % 10
RESULT += digit ** power
temp //= 10
# display the result
if num == RESULT:
print(num,"is an Armstrong number")
else:
print(num,"is not an Armstrong number")
# So, this would work perfectly fine.
Not copied ok!!!
Hello Subrat, I am also confused that why my code is not working. However, the way you suggested is Good. You can proceed with that. I am just trying to find out the loop hole as to why my code fails the this instance.
@@codeitup I also stucked in the same question thanks subrat for the solution and the problem is that i think for 3 digit ex.153=1*1*1+5*5*5+3*3*3 is correct but when it comes to 4 digit number we have to find it like this 1634=1*1*1*1+6*6*6*6+3*3*3*3+4*4*4*4 but in the video it is sum=sum+(i%10) *(i%10) *(i%10) so it work for only for 3 digit.This is the reason its not working .Btw thank you sir for your videos it is helpful
@@nehapandey2167 Yes, my code will work only for three digit number. I will modify it.
It is so good to hear that people are benefiting by this code. Thank u so much everyone.😇
Find here the new program for Armstrong for any number of digit:
ua-cam.com/video/0uRtnZXMfqM/v-deo.html
Sir thank you so so much because I am not able to understand program but after watching your video's I do programme very well.👌👌👌👌
Most welcome Kabir !
You teach the logics for program in very understandable way . thank you sir 😊
Step by step process is best way to teach....u r doing great 👍
Sir best series of python. Any one who is finding it hard to learn python can learn with codeitup because of the best explanation. Plus he teaches us with a lot of examples.
BTW sir I have a suggestion that it would be better if you teach us with games also.....
Sure, chinmoy. I will upload all the videos!
Sir you are just awesome great sir💜 keep it up sir and we want more videos.. Like this
So nice of you!
Really a big fan of sir
Thanks Sujal🙂
I have one request to you, Please make videos on Django Tutorial.
sir this logic gives correct result only for 3 digit number, for four digit and so on need to do some changes everytime
your described is fantastic sir. thank you very much
Thanks & most welcome Mubeen!
What a tutorial sir
Thank you so much 😀
Thanks & most welcome Ajey!
Sir...u are way too amazing..ur teaching methods are so easy...
Glad to be learning from you😊😊
Thanks a lot dear!
Thank you sir for this tutorial
Most welcome Saroj!
ATQ, What about digits > or < 3 Armstrong numbers ?
Sir armstrong number is not only used for doing cube of any number it is used for doing the power of the total number of digits available in original number
For example,
abcd= (4*pow(a))+(4*pow(b))+(4*pow(c))+(4*pow(d))
Here there are four digits in abcd number then it is used as 4 power of all the elements of abcd number
Ur the best teacher sir❤️❤️
Thank you so much Mahesh!
Very helpful sir..keep it up😄
Keep Learning HardDecoder!
Can we do it if we calculate the length of integer by using l=len(str(i))
And then use
S=sum+i**l
Plz reply
Next level explanation sir..
Keep watching🙂
Sir you are amazing mind-blowing
Superb teaching sir
Thanks Dharmendra!
nice explanation
🙏
Another alternative method to calculate the Armstrong Number:
### Get the number
n = int(input("Enter the number: "))
### Convert to string
n1 = str(n)
### String Count
count = len(n1)
### add string to list
n1 = [int(i) for i in n1]
### find the power of each number by its count and store in D list
D = [ ]
for i in n1:
j = i ** count
D.append(j)
### Initiate the dummy variable for the addition of list
sums = 0
for num in D:
sums += num
### Driver function to check the number is Armstrong or not.
if n == sums:
print("Its Armstrong Number.")
else:
print("Not an Armstrong number.")
Quite a lengthy method. However, good effort.
Your explained very well SIR ❤️
Thanks Aaryan!
Code explanation was good .... but, how did u figure out what to write inside the while loop... how do we crack it ,
or do we need to remember that fourmla.... ????????
I think you watched this program directly. If you will see the programs I have uploaded just before this, you will know the concept how to figure out the logic for this program.. All my videos are step by step. See the video just before it i.e. tutorial 22 and 23 and you will understand how to figure out the logic.
Thanks for superb explanation. Sir, the above code is for 3 digit number separately and we can write it for 4 digit number also separately(sum=sum+(i%10)**4). But, How to write a single code to check whether a number is Armstrong or not for any digit?
ua-cam.com/video/0uRtnZXMfqM/v-deo.html
sir thinks a lot.its really helpful
Keep Learning ☺️
Thank you so much sir.. this video was really help me lot..
You are most welcome🙂
i have one doubt zero is also an armstrong number but why have you written (i>0)??Please elaborate on this
In such case we need not to run the loop. Sum contains zero and the input number is also zero. Both are equal so it will print Armstrong.
Thank you sir🙏🙏
Most welcome!
Hi please consider easiest way:
n1=input("Enter the number :")
c1=[int(e) **len(n1) for e in n1]
c2=(sum(c1))
If str(c2) ==n1:
print ("its a Armstrong number")
else:
print ("Not a Armstrong number")
Ha
Best video on Armstrong.....
Thanks a ton dear😊
sir very nice video....excellent
Thanks Dhruv !
Good work 👍 keep it up
Thanks Ojas. Keep Supporting.
Tqsm sir very helpful video tqsmm sir❤
Thanks a lot 😊
Awesome video sir,👍👍👍👍👍👍
Thanks a ton🙂
Sir you are fabulous
Thanks a ton Karan!
Awesome explanation sir! Keep going like this.👏👍
Thank you, I will Viddushi !
Sir can you please tell me how to study computer science in class 11 😭😭😭
And also I don't know any basics but unfortunately I had taken cs in class 11..
What a wonderful video sir u r great
Thanks a ton Amazed!
Very nice lecture
🙂
Thankyou so much 😀...
Thanks Naitik. Support this channel to grow.
I just wanna say that you are awesome
🙂
sir,can we print all armstrong number between 1 To N , where N is any number.
If yes, then what is the program?
Yes we can do that. First I would request you to try at your end and paste your code here and then I will let you know the rectification.
i = int(input("enter the number:"))
n = len(str(i))
orig = i
sum = 0
while i>0:
sum = sum + pow(i%10,n)
i = i//10
if orig == sum:
print("Its an armstrong number")
else:
print("itz not an armstrong number")
@@anveshkota2347 yup this is for n digits
Love you sir
😊
Sir can you please make a video on the.sum of the following series
X+x^2/2!-x^3/3!+x^4/4! -...+x^n/n!
Sir your explanation is too good..
But in this vdo you are forget Armstrong is not a equal of cubes..
This programme runned only 3 digits..
Yes rishabh, Thanks for letting me know this fact. I will make a new video on it.
Ok sir..
@@rishabhmishra233 Find the New Armstrong program video here:
ua-cam.com/video/0uRtnZXMfqM/v-deo.html
Sir please can you explain program to search between 1 to 1000 Armstrong number
Sir I have a doubt in this program, Sir when I run this program and enter 3 digits Armstrong no, it show number is Armstrong but when I enter 4 digit Armstrong number it shows that the number is not Armstrong... I request you to plzz solve my doubt
Sir can i write the program like this i=int(input("enter number to check for Armstrong:"))
orig=i
j=i
sum=0
count=0
while(i>0):
i=i//10
count=count+1
while(j>0):
sum=sum+(j%10)**count
j=j//10
if orig==sum:
print("Number is Armstrong")
else:
print("Number is not Armstrong")
Thank you sir
Sir can we use
import math
And then later use math.pow((i%10),3)
Yes, you can but is prohibited when you write the program in exam. You can also use:
(i%10)**3
Why to use math module?
@@codeitup means in paper it will be wrong
@@gurjitkaur8750 I think so. Using built in function is prohibited.
Nice
Thanks dear😊
Hey I have a doubt,
How is the program taking last no. Of
Like in 153 first three is taken then 5 then one
I have explained the dry run concept, please watch full video and you will come to know about it.
sir if user enter 5 digit number then how it logic work.
Sir one stupid question.... Instead of == operator .. Can we use =....
If( sum=n)... Can we write sir.????
Not a stupid question. Question is always a question Rabiraj.
= is used to transfer values viz a=3, b=6
== is used to check whether two values are equal or not.
So, = & == both are completely different.
Thank u very very much sir❣🙏
Most welcome🙂
sir why we are storing i in orig and what will happen when we don't do that.
i will lose its value, then while comparing with the sum variable, it will never be equal and always giving you the answer :
"Not Armstrong".
Sir please tell what I'd we have take 2 inputs
👏👏🙏🙏🙏thanks sir
Most welcome!
Tq clear explanation
Most welcome Navya!
The only thing holding me from taking sanyas from youtube
Thank you bahi g
Welcome dear.
Sir benifit of membership????
Rs 159/- is just for supporting codeitup in which you may ask you question in comment box and you will definitely get a reply. But Rs 799/- is the most impressive one in which you will get my contact number and you can ask questions directly to me. Even, you can have one to one doubt clearing session once in a month.
Veree level🔥🔥🔥
If the number is of 4 digits or more then the program will not work...so what to do for that?
By the way thank you sir❤️
Most welcome, for any number of digits follow:
ua-cam.com/video/0uRtnZXMfqM/v-deo.html
ty
What if we can't write I//10
It is not working but also not showing no. is not armstrong
In python in armstrong number program why original number store in new veriable
Sir 4 digit ka no direct (no. is not Armstrong ) output ata hai
Sir how we will do strong number????
Sir 4 digit numbers like 8204 wont work in this program]
if we write 1634 this is also armstrong number but its coming wrong acording to your code pleace make me understand this for only 3 digit if we write for digit of arm strong then anser is not coming
ua-cam.com/video/0uRtnZXMfqM/v-deo.htmlsi=KTvKmsEi9_rwNiTP