Sir..I want to say something. I watched several videos on TH-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
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😄😊
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.....
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 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.")
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")
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.
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..
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: th-cam.com/video/0uRtnZXMfqM/w-d-xo.html
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.
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.
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")
armstrong number is not only sum of cubes. if ex.35624 is 5 digit no. then sum of 5th power of all digit need to be same as 35624(original) if there has 12 digit no. then it should be same as sum of 12th power of all digits in it.
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")
Sir..I want to say something. I watched several videos on TH-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 😊
Logic was so simple to understand. I'm from non IT background and your channel is perfect for understanding the basic.
Thanks Sundeep
Best videos in the you tube for beginners
😊
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!
Your teaching skill is exceptionally phenomenal❤❤
THANK YOU SIR. You and Your teaching is unique and excellent.
Thanks & most welcome Suraj!
right sir you are amazinggggggggggggggggggggg
Your explanation is crystal clear sir
Thanks😊
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 :)
The way you teach everyone will learn sir.
I just try to make videos as simple as possible. Keep supporting, keep learning.
Your explanation is awesome sir
Thanks😊
I will definitely share your videos with my friends.
Thanks Suraj😊
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🙏
Awesome videos sir... They are really helpful... Very nice
Glad to help you Deeksha!
The way yoy teach is amazing sir👍
Thanks Meena, help this channel to grow. Keep learning keep supporting!
Perfectly Explained , I understood totally ,Thank you sir... I like the way you teach,always from basic...
Thanks & most welcome Abhishek 😊
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 TH-cam video.
🙂👍
Too much simplicity in u'r video's.. Really I like it.. 🙌
Thanks Pratibha!
Sir aap bahut achhe se samjhate h thank you
Thanks & most welcome Puja!
Sir really you are awesome so nicely explained.
Love u sir ji
My pleasure Yash, keep learning!
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 !
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 😊
Step by step process is best way to teach....u r doing great 👍
Jese Apne Smjhaya H... koi baccha Bhi smjh Jaye ga, ❤️❤️❤️❤️👌👌👌👌 nice guruji
Thanks Dear !
You teach the logics for program in very understandable way . thank you sir 😊
thank you very much sir. helped me a lot one week before the practical exam
You are most welcome!
Sir...u are way too amazing..ur teaching methods are so easy...
Glad to be learning from you😊😊
Thanks a lot dear!
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!
your described is fantastic sir. thank you very much
Thanks & most welcome Mubeen!
Really a big fan of sir
Thanks Sujal🙂
Sir you are just awesome great sir💜 keep it up sir and we want more videos.. Like this
So nice of you!
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 !
Your explained very well SIR ❤️
Thanks Aaryan!
Next level explanation sir..
Keep watching🙂
Ur the best teacher sir❤️❤️
Thank you so much Mahesh!
Very helpful sir..keep it up😄
Keep Learning HardDecoder!
nice explanation
🙏
What a tutorial sir
Thank you so much 😀
Thanks & most welcome Ajey!
Bahut hi useful video..👌
Sir apki video sirf 360 pe hi chalti hai 240 pe nahi aisa kyun ?
Superb teaching sir
Thanks Dharmendra!
Thank you sir for this tutorial
Most welcome Saroj!
Best video on Armstrong.....
Thanks a ton dear😊
Sir you are amazing mind-blowing
sir thinks a lot.its really helpful
Keep Learning ☺️
Good work 👍 keep it up
Thanks Ojas. Keep Supporting.
sir very nice video....excellent
Thanks Dhruv !
Nice explanation..!!!
But this program is for 3-digit numbers only.
Sir you are fabulous
Thanks a ton Karan!
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
Awesome explanation sir! Keep going like this.👏👍
Thank you, I will Viddushi !
Very nice lecture
🙂
Thank you so much sir.. this video was really help me lot..
You are most welcome🙂
ATQ, What about digits > or < 3 Armstrong numbers ?
Awesome video sir,👍👍👍👍👍👍
Thanks a ton🙂
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:
th-cam.com/video/0uRtnZXMfqM/w-d-xo.html
What a wonderful video sir u r great
Thanks a ton Amazed!
I have one request to you, Please make videos on Django Tutorial.
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
sir this logic gives correct result only for 3 digit number, for four digit and so on need to do some changes everytime
I just wanna say that you are awesome
🙂
Thanks a lot 😊
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.
Thankyou so much 😀...
Thanks Naitik. Support this channel to grow.
Tqsm sir very helpful video tqsmm sir❤
Thank you very much
Most welcome Debatra!
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?
th-cam.com/video/0uRtnZXMfqM/w-d-xo.html
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
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.
Love you sir
😊
Thank you sir
Veree level🔥🔥🔥
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.
ty
Nice
Thanks dear😊
👏👏🙏🙏🙏thanks sir
Most welcome!
Tq clear explanation
Most welcome Navya!
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..
Thank u very very much sir❣🙏
Most welcome🙂
Thank you bahi g
Welcome dear.
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.
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: th-cam.com/video/0uRtnZXMfqM/w-d-xo.html
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.
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.
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:
th-cam.com/video/0uRtnZXMfqM/w-d-xo.html
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
Sir please can you explain program to search between 1 to 1000 Armstrong number
Thank u sir
Welcome !
Sir please tell what I'd we have take 2 inputs
armstrong next method baata dijiye sir
sir if user enter 5 digit number then how it logic work.
nice
😊
Hats off 🙏🙏
😊🙏
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.
Helpfull❤️
Glad to help you
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 can we do it using for loop
Yes we can, convert the while into for. Try it and paste your code here.
armstrong number is not only sum of cubes.
if ex.35624 is 5 digit no.
then sum of 5th power of all digit need to be same as 35624(original)
if there has 12 digit no.
then it should be same as sum of 12th power of all digits in it.
@Bharathi Pravallika Sagireddy Find here the new program for Armstrong for any number of digit:
th-cam.com/video/0uRtnZXMfqM/w-d-xo.html
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")
Sir how we will do strong number????