Python Program to Check If the Number is Armstrong or Not?

preview_player
Показать описание


WsCube Tech is a leading Web, Mobile App & Digital Marketing company, and institute in India.

We help businesses of all sizes to build their online presence, grow their business, and reach new heights.

All the courses are job-oriented, up-to-date with the latest algorithms and modules, fully practical, and provide you hands-on projects.

📞 For more info about the courses, call us: +91-7878985501, +91-9269698122

✅ CONNECT WITH THE FOUNDER (Mr. Kushagra Bhatia) -

Connect with WsCube Tech on social media for the latest offers, promos, job vacancies, and much more:

--------------------------------------| Thanks |---------------------------
#python #pythontutorials #pythonprogramming
Рекомендации по теме
Комментарии
Автор

😎Hey, thanks for watching! We’d love to know your thoughts/doubts here in the comments.

wscubetech
Автор

x = int(input(" enter a value of x : "))
y = int(input(" enter a value of y : "))
z = int(input(" enter a value of z : "))
xyz = int(str(x) + str(y) + str(z))
answer = x**3 + y**3 + z**3
if answer == xyz:
print(" this is an Armstrong number ")

else:
print(" This isn't an Armstrong number ")


THANK ME LATER

icxchuv
Автор

i have done using type castings

def armstrong(num):
su=0
for i in num:
su=su+int(i)**3

print(su)
if int(num)==int(su):
return True
else:
return False

num=input(" Enter the number ")
res=armstrong(num)
print(res)

bukkepradeepnaik
Автор

very simple : num1 = input("Enter a number : ")
length = len(num1)
c=0
for i in num1:
c += int(i)**int(length)
if int(num1) == c:
print(num1, "is a Armstrong number")
else:
print(num1, "is not a Armstrong number")

PythonProjectSolver
Автор

nice madam ji aap ki voice bahot achhi hai thanks

Vikas__vlog_panti
Автор

very nice teaching. I understood very well. Your logic is simple but clear. This is the quality of good programmer.

xqduqhr
Автор

def armstrong_number(number):
item in str(number))
if alpha == number:
print(f"given number is an armstrong number")
else:
print(f"given number is not an armstrong number")
it will work for each case correct me if i am wrong

UmeshKumar-uywe
Автор

Yes i didn't know what is Armstrong number

kocengineering
Автор

so confusing please make more simple explanation

maroofkhan
Автор

no=input("no")
c=int(no)
d=0
for i in no:
a=int(i)**len(no)
print(a)
d=d+a
if c==d:
print(f"{no} is armstrong number")
else:
print(f"{no} is not armstrong number")

vklxcjy
Автор

Hello sales funnel kaise bnaue video bna do please 🙏

facebookapp
Автор

hi! i regularly follow your channels and the python programing lectures you posted on your channel, it really helped me alot.
but, in this video i think you accidently narate the wrong statement and put wrong inputs during program execution. Let me narate how:
As per "armstrong rule", length of the number entered will the power of each digit, so fixed the digit cube with (3) in logic and during the program execution your also giving input a two digit number (which is wrong as per the logic and as per your given naration in the beginig of video.). SO this program is not a general program. Please correct this video. i hope my this help will not effect ur fab. reputation for the next student who gonna watch this.
Please watch your this video carfully.
Thanx. :) Lots of Luv to WsCube <3

manisofat
Автор

Mam ye sirf 3 digit ke liye applicable hai na ?

Aditya
Автор

why its not working if i am not using temp variable either of it i am directly using num on its place

justplay
Автор

This program is wrong mam it will not work for any no which has greater than 3 digits.

harshitsrivastava
welcome to shbcf.ru