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
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
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
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.....
RIGHT WAY TO CREATE THIS PROGRAM 😊 n=int(input("enter num here:")) sum=0 order=len(str(n)) orig=n while n>0: digit=n%10 sum=sum+(digit**order) n=n//10 if sum==orig: print("armstrong") else: print("not an armstrong") IS RIGHT PLEASE LIKE 😊😊
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.")
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
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")
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
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?
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")
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 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")
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 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..
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 😊
Sir you are best teacher for cs pls 11 ke chapter aur 12 ke hr chapter ko sumita arora wali book se pdhao plssssssssss
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 :)
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
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
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 😊
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 crystal clear sir
Thanks😊
Perfectly Explained , I understood totally ,Thank you sir... I like the way you teach,always from basic...
Thanks & most welcome Abhishek 😊
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🙏
I will definitely share your videos with my friends.
Thanks Suraj😊
Best videos in the you tube for beginners
😊
Jese Apne Smjhaya H... koi baccha Bhi smjh Jaye ga, ❤️❤️❤️❤️👌👌👌👌 nice guruji
Thanks Dear !
Step by step process is best way to teach....u r doing great 👍
The way yoy teach is amazing sir👍
Thanks Meena, help this channel to grow. Keep learning keep supporting!
Awesome videos sir... They are really helpful... Very nice
Glad to help you Deeksha!
Sir...u are way too amazing..ur teaching methods are so easy...
Glad to be learning from you😊😊
Thanks a lot dear!
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, 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 !
You teach the logics for program in very understandable way . thank you sir 😊
Sir really you are awesome so nicely explained.
Love u sir ji
My pleasure Yash, keep learning!
Really a big fan of sir
Thanks Sujal🙂
Too much simplicity in u'r video's.. Really I like it.. 🙌
Thanks Pratibha!
Your explanation is awesome sir
Thanks😊
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 !
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!
thank you very much sir. helped me a lot one week before the practical exam
You are most welcome!
Very helpful sir..keep it up😄
Keep Learning HardDecoder!
What a tutorial sir
Thank you so much 😀
Thanks & most welcome Ajey!
Next level explanation sir..
Keep watching🙂
Ur the best teacher sir❤️❤️
Thank you so much Mahesh!
RIGHT WAY TO CREATE THIS PROGRAM 😊
n=int(input("enter num here:"))
sum=0
order=len(str(n))
orig=n
while n>0:
digit=n%10
sum=sum+(digit**order)
n=n//10
if sum==orig:
print("armstrong")
else:
print("not an armstrong")
IS RIGHT PLEASE LIKE 😊😊
Sir aap bahut achhe se samjhate h thank you
Thanks & most welcome Puja!
Sir you are best teacher for cs pls 11 ke chapter aur 12 ke hr chapter ko sumita arora wali book se pdhao plssssssssss
your described is fantastic sir. thank you very much
Thanks & most welcome Mubeen!
Good work 👍 keep it up
Thanks Ojas. Keep Supporting.
Your explained very well SIR ❤️
Thanks Aaryan!
Thank you sir for this tutorial
Most welcome Saroj!
Sir you are amazing mind-blowing
Thank you so much sir.. this video was really help me lot..
You are most welcome🙂
Awesome video sir,👍👍👍👍👍👍
Thanks a ton🙂
Awesome explanation sir! Keep going like this.👏👍
Thank you, I will Viddushi !
sir thinks a lot.its really helpful
Keep Learning ☺️
Superb teaching sir
Thanks Dharmendra!
Best video on Armstrong.....
Thanks a ton dear😊
Bahut hi useful video..👌
Sir apki video sirf 360 pe hi chalti hai 240 pe nahi aisa kyun ?
sir very nice video....excellent
Thanks Dhruv !
Thankyou so much 😀...
Thanks Naitik. Support this channel to grow.
What a wonderful video sir u r great
Thanks a ton Amazed!
Tqsm sir very helpful video tqsmm sir❤
nice explanation
🙏
I just wanna say that you are awesome
🙂
Sir you are fabulous
Thanks a ton Karan!
Thanks a lot 😊
Chaliye start karte hai 🎉
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.
Very nice lecture
🙂
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
Nice explanation..!!!
But this program is for 3-digit numbers only.
Veree level🔥🔥🔥
Thank u very very much sir❣🙏
Most welcome🙂
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
I have one request to you, Please make videos on Django Tutorial.
👏👏🙏🙏🙏thanks sir
Most welcome!
Love you sir
😊
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
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
Thank you very much
Most welcome Debatra!
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.
ATQ, What about digits > or < 3 Armstrong numbers ?
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
Thank you sir
Hats off 🙏🙏
😊🙏
Sir please tell what I'd we have take 2 inputs
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 this logic gives correct result only for 3 digit number, for four digit and so on need to do some changes everytime
Hello Sir,
I am getting Syntax error (Invalid syntax) for the above code s = s +(i%10)*(i%10)*(i%10)..Please help
#codeitup I think you have mistypes something Rajita. Copy and paste your code here and I will let you know the error.
@@codeitup i=int(input())
sum = 0
orig = i
while (i>0):
sum=sum+ (i%10)*(i%10)*(i%10):
i = i//10
if orig==sum:
print('True')
else:
print('False')
At last of statement,
sum=sum+i%10*i%10*i%10:
Why at last there is : sign? It shluld not be there.
@@codeitup Thanks sir, it worked!! I'm too new to Python n make such silly mistakes
No problem Rajita, keep learning ☺️
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
Helpfull❤️
Glad to help you
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.
What if we can't write I//10
It is not working but also not showing no. is not armstrong
Thank you bahi g
Welcome dear.
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
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 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 4 digit numbers like 8204 wont work in this program]
Tq clear explanation
Most welcome Navya!
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.
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
This code is only valid upto 3 digit numbers and not more than 3
Sir 4 digit ka no direct (no. is not Armstrong ) output ata hai
Thank u sir
Welcome !
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:
ua-cam.com/video/0uRtnZXMfqM/v-deo.html
How would we know that how many digits number the user will enter
In the program we are running the loop till number>0 and we are dividing the number every time with 10 which we remove the last digit..
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..
ty