Python Program to Check Armstrong Number

Поділитися
Вставка
  • Опубліковано 18 жов 2024
  • Armstrong number in Python: In this video, we will write a Python program to find Armstrong number
    Python Practice Playlist: • Python Practice Progra...
    ►Checkout my English channel here: / programmingwithharry
    ►Click here to subscribe - / @codewithharry
    Best Hindi Videos For Learning Programming:
    ►Learn Python In One Video - • Python Tutorial In Hin...
    ►Python Complete Course In Hindi - • Python Tutorials For A...
    ►C Language Complete Course In Hindi -
    • C Language Tutorials I...
    ►JavaScript Complete Course In Hindi -
    • JavaScript Tutorials I...
    ►Learn JavaScript in One Video - • JavaScript Tutorial
    ►Learn PHP In One Video - • Learn Php In One Video...
    ►Django Complete Course In Hindi -
    • Python Django Tutorial...
    ►Machine Learning Using Python - • Machine Learning Tutor...
    ►Creating & Hosting A Website (Tech Blog) Using Python - • [Hindi] Web Developmen...
    ►Advanced Python Tutorials - • Intermediate/Advanced ...
    ►Object Oriented Programming In Python - • Object Oriented Progra...
    ►Python Data Science and Big Data Tutorials - • Python Data Science an...
    Follow Me On Social Media
    ►Website (created using Flask) - www.codewithhar...
    ►Facebook - / codewithharry
    ►Instagram - / codewithharry
    ►Personal Facebook A/c - / geekyharis
    Twitter - / haris_is_here

КОМЕНТАРІ • 259

  • @CodeWithHarry
    @CodeWithHarry  4 роки тому +122

    Armstrong to theek hai lekin ye Binod kon hai?

  • @siddheshphadke3719
    @siddheshphadke3719 4 роки тому +38

    I m 14yrs old and we r not taught programming in school, I started learning programming in 6th, and am an intermediate python coder, all just bcoz of you, hope you read and if yes, plz reply or give a ❤️👍😊☺️

  • @sangeetawadhwani5515
    @sangeetawadhwani5515 4 роки тому +16

    Harry bhai, you are a wonderful teacher and programmer

  • @thengc2676
    @thengc2676 2 роки тому +9

    I took a different approach!
    n = input('Enter the number: ')
    length = len(n)
    value = 0
    for i in n:
    a = int(i)**length
    value = value + a
    print(value)
    if value == int(n):
    print('The number is an Armstrong number!')
    else:
    print('The number is not an Armstrong number.')

    • @thengc2676
      @thengc2676 Рік тому

      @Malik Abdullah Nasir it's is nice coincidence
      so why are u learning to code

  • @ruchirmandora4656
    @ruchirmandora4656 3 роки тому +1

    Great way to make us acually realise HOW TO CODE !!!!!!!!!!!!

  • @DOWN3X_FF
    @DOWN3X_FF 17 днів тому

    def haarms(n):
    n=str(n)
    ghat=len(n)
    ds=0
    for d in n:
    ds+=(int(d)**ghat)
    ds=str(ds)
    return (ds==n)
    print(haarms(153))

  • @harshitachaurasia1246
    @harshitachaurasia1246 4 роки тому +1

    Aisa lgta h aap pura mere college k sath chl rhe ho same...topic there same topic here even in same lang
    So nice of u

    • @yashbansal1414
      @yashbansal1414 4 роки тому +1

      Plot Twist: Harry and you are in same college, but he didn't revel his identity yet 😂😂😂

    • @harshitachaurasia1246
      @harshitachaurasia1246 4 роки тому

      @@yashbansal1414 😂😂😂kash

  • @TecSantoshKumar
    @TecSantoshKumar 4 роки тому

    Apki waja se mai apne sapne pure kr pa rahahun Mai apni kud ki websites banali h ab mai bahut jald payse Arun kr pauga
    Lekin yh bat Jan kr bahut khushi ho ki mai ek electrical engineering karne wala student apki waja se ek Web developer bn paya.

  • @programmingtricks833
    @programmingtricks833 4 роки тому +1

    Harry bhai theak haa code
    number = input("Number Enter:
    ")
    lennumber = len(number)
    sum=0
    for i in number:
    square= int(i)**lennumber
    sum+=square
    if int(number) == sum:
    print("Number is Armstrong")
    else:
    print("Number is not Armstrong")

  • @yashwanthaas3233
    @yashwanthaas3233 2 роки тому +1

    Thank you very much!

  • @mehulrathod7299
    @mehulrathod7299 4 роки тому +3

    Harry bhai this would also work:
    from math import pow
    z = (input("Enter a number: "))
    p = list(z)
    c = 0
    for i in range(0, len(p)):
    t = pow(int(p[i]), len(p))
    c = c+t
    if int(z) == c:
    print(f'{z} is an armstrong number')
    else:
    print("Not an armstrong number")

    • @abhishekpandey3070
      @abhishekpandey3070 Рік тому

      🔥🔥🔥

    • @dakshmehan4114
      @dakshmehan4114 9 місяців тому

      another possible solution is this
      num=input('please enter the number in question')
      n=len(num)
      sum=0
      for digit in num:
      sum+=int(digit)**int(n)
      if int(sum)==int(num):
      print('it is an armstrong number')
      else:
      print('it is not an armstrong number')

  • @channelpro2284
    @channelpro2284 4 роки тому +1

    You are great genius coder.

  • @linujose2536
    @linujose2536 4 роки тому +2

    excellent bhai this question was asked to me in one of the interviews i faced recently !

  • @lokeshpatil6595
    @lokeshpatil6595 4 роки тому

    Harry bhai apke channel per java ke tutorial nahi hai. So please upload full java course begineer to advanced. Apse achha koi nahi samjata hai pure youtube per.

  • @DeepakGupta-hd1ns
    @DeepakGupta-hd1ns 4 роки тому +2

    Number ki digits ke liye calculation ki kya need hai? Number ko string me convert karke uski index ke liye bhi loop chla sakte hai.

  • @itzjvs9052
    @itzjvs9052 4 роки тому

    Bro video dekhne se pahele..main try Kiya...🤗🙈 aur Success bhi Mila..😎🙈✌. You are ossm bro..✌

  • @parthgupta4850
    @parthgupta4850 4 роки тому

    Harry bhai ur best programming teacher

  • @mohammadbilgrami
    @mohammadbilgrami Місяць тому

    n = 1634
    Order = len(str(num))
    Sum = 0
    Temp = n
    While

  • @siddharth840
    @siddharth840 3 роки тому

    thanks brother its help me a lot

  • @jitendradashora8956
    @jitendradashora8956 Рік тому

    def isArmstrong(number):
    numList = list(str(number))
    sum = 0
    for numbers in range(len(numList)):
    sum = sum + int(numList[numbers]) ** len(numList)
    if sum == int(number):
    print(f"Yes {number} is a Armstrong number")

  • @vaibhavyadav8726
    @vaibhavyadav8726 4 роки тому +4

    9:09 We've changed the value of n in loop.

  • @mercesletifer6625
    @mercesletifer6625 2 роки тому +1

    Perfect explanation sir... I wish i had a teacher like you🙄🙄🙄

  • @schooldays5817
    @schooldays5817 4 роки тому

    Sirji apke tutorial BHOT badiya hote hai....kya aapp Java programming language ke tutorial leke aa skteho

  • @nareshgoyal1994
    @nareshgoyal1994 4 роки тому

    Harry bhia aapka internet really superfast hai.. Bilkul aapki tarah 🔥🔥🔥🔥

  • @shivanksharma5443
    @shivanksharma5443 4 роки тому +3

    Sir you have made learn linux in one video tutorial and it helped me a lot. Can you make a full tutorial on linux. Please..🙏🏻🙏🏻🙏🏻
    And if it is already there then can anyone provide me the link.

  • @bedifferent8166
    @bedifferent8166 4 роки тому +9

    there should be temp = n, as n keeps changing and becomes 0 at last. SO we have to store the input value to a temp variable

  • @sumeetnegi9934
    @sumeetnegi9934 4 роки тому

    Bhai mast video banai hai.. aise hi aur banao yrr

  • @codepotato1537
    @codepotato1537 4 роки тому

    good explanation harry

  • @rupamhari115
    @rupamhari115 4 роки тому

    harry bhai.. aap ka web development course bohot hi accha tha. please start a course on angular or reactJS.

  • @adityajadhavar9675
    @adityajadhavar9675 4 роки тому

    Bohot achhe harry bhai.Please aise aur practice programs banaye

  • @machhindrasmathematics2551
    @machhindrasmathematics2551 Рік тому

    Make video on anagram of strings

  • @varuntripathi6928
    @varuntripathi6928 4 роки тому

    Harry bhai Main final year student abhi start hua hai mujhse data Structure kuch khass nhi aata main ye jaanna chahta hu ki aapki data structure ki series kitni time pr khatam hogi ek guzaris smjho yaa apne bhai ki request try to upload videos regarding Data Structures and Algorithm only not other stuff. This will help me out. Aapke DS and algo series mujhe pasand aayi aur main use continue krna chahta hu.
    If u read my comment kindly reply.......
    Write now I am taking ur Complete C tutorial that is awesome itna aache se toh hamare professor ne bhi nhi smjhaya.
    So, think About it please......................

  • @promakanungoe8294
    @promakanungoe8294 4 роки тому

    Please make tutorial for java...mostly needed.

  • @hari_1357
    @hari_1357 5 місяців тому

    Thank you soooooo much!!

  • @goodbye4589
    @goodbye4589 3 роки тому

    a=int(input())
    b=[]
    for i in str(a):
    c=int(i)
    b.append(c**len(str(a)))
    if sum(b)==a:
    print(f"{a} is an Armstrong number")
    else:
    print("No it is not")

  • @sarenkumar6108
    @sarenkumar6108 2 роки тому

    number shd be assinged in another temporray variable the equate in if block

  • @clashcloud5720
    @clashcloud5720 4 роки тому +1

    Harry bhai.... debugging pe bhi video bana do plzzz

  • @adityarathod6924
    @adityarathod6924 4 роки тому

    Harry Bhai ....love u....i was very obssessed with code when i first learn from another UA-cam channel....but when i started watching your vdo.....swear to god.....siddha dimaag me gushta hai......maja aa gaia....Love u bro....Maja aa gaia

  • @souravkumar7283
    @souravkumar7283 4 роки тому +2

    Perfect teaching skills 👌

  • @rajrajaparmar7138
    @rajrajaparmar7138 4 роки тому

    Sir you are great but please tell me about how to make games and app by python

  • @ron_stark4179
    @ron_stark4179 4 роки тому +1

    Sir,
    Please please please make a video on Pyside2 Qt5 please please make video

  • @vasugarg2293
    @vasugarg2293 4 роки тому +1

    Yeh raha armstrong number ko check karne ka code.
    num = input("Enter the number:
    ")
    lst = []
    for c in num:
    lst.append(int(c)**int(len(num)))
    if sum(lst) == int(num):
    print("This number is a armstrong number")
    else:
    print("This number is not a armstrong number")

  • @maheshappaji1273
    @maheshappaji1273 2 роки тому

    thank you

  • @SomneelMaity
    @SomneelMaity 4 роки тому

    please post more python programs like this

  • @RohitKumar-go2is
    @RohitKumar-go2is 4 роки тому

    Sir please make a video on which desktop is best for for programming

  • @kedargalande3193
    @kedargalande3193 2 роки тому +1

    Very well explained!

  • @adamsaleh8018
    @adamsaleh8018 4 роки тому

    c# ke upar bhi ak complete tutarial banado . bohathi acccha hoga

  • @prithvivirajgupta1282
    @prithvivirajgupta1282 3 роки тому

    harry bhaiya thnx mai 13ka hu aur coding sikh rh hu thnx

  • @anonymusk9397
    @anonymusk9397 4 роки тому +1

    Bro make this series in python too please🙏🙏🙏🙏🙏🙏

  • @vanshikashah3013
    @vanshikashah3013 4 роки тому

    Yes variable kisi or value me save karna padega

  • @Sampoorna.
    @Sampoorna. Рік тому

    Can this be done with for loop???

  • @lakshyaarora1423
    @lakshyaarora1423 3 роки тому

    n ki value while loop ke endgame ke baad 0 hogi kyuki floor division of last 8//10=0 dega
    n ki value intact toh nhi thi badal gayi aur agar ap uss n ki value se program krte ho toh not an Armstrong aayega

  • @sumitadkhale2760
    @sumitadkhale2760 4 роки тому

    Harry bhai Apptitude and Reasoning Job pane ke liye jaruri hai kya uspe video banao or jaruri hai to kese kar sakte hai or kaha se vo batao pls . . .

  • @VivekKumar-qn9fj
    @VivekKumar-qn9fj 4 роки тому

    Make video on css animations

  • @akhalaqmonis4713
    @akhalaqmonis4713 4 роки тому

    Awesome program harry bhai.......
    And last main ji tune bajate ho uska naam kya hai??

  • @ayushkhare3455
    @ayushkhare3455 4 роки тому

    Harry bhai can you please make tutorials on Java pls

  • @nishishaandilyaa
    @nishishaandilyaa 3 роки тому +1

    Thank you harry for this great vedio... Lots of love your way... ❣️❣️ keep making us more perfect in python.

  • @kirandhumal1799
    @kirandhumal1799 Рік тому

    Shukriya bhai ❤

  • @ishaankapoor933
    @ishaankapoor933 4 роки тому +1

    lambda n: n == reduce(lambda x, y: x + y, [int(str(n)[i]) ** len(str(n)) for i in range (len(str(n)))])

  • @rajuraghuwanshi2537
    @rajuraghuwanshi2537 2 роки тому +1

    perfect 👌👌

  • @technicalraxo5385
    @technicalraxo5385 4 роки тому

    Thanks so much sir

  • @yourintrovertguy
    @yourintrovertguy 4 роки тому +1

    Please also make video in machine learning project and also data structure and algorithms in python.....

  • @Ammarkoka
    @Ammarkoka 4 роки тому +9

    Please make a series on data structures and algorithms in python please. 🔥💯

  • @krishalkhadgi3393
    @krishalkhadgi3393 2 роки тому +1

    num, sum = input("Enter a number: "), 0
    for i in num:sum += (int(i) ** len(num))
    if (sum == int(num)):print(f"{num} is an Armstrong number.")
    else:print(f"{num} is not an Armstrong number")
    sir this is the shortest code i can write for this problem please verify

  • @mightyit7483
    @mightyit7483 4 роки тому

    Bhai ek question hai important ,do you know how can we read the data which is in ram ?

  • @technicalraxo5385
    @technicalraxo5385 4 роки тому

    I am big fan of you..
    Name: Rajveer singh

  • @madhujain2871
    @madhujain2871 4 роки тому +1

    Space tech sikhao please jo whitehat jr me sikhate hai faaltu me 1 lakh rupees charge karte hai jabki aap ye sab chize free me dete hai you are great human being par please ek baar whitehat jr ka course dekho or uspe ek playlist banao

  • @विवेकअवस्थी-ङ5द

    Sir how are you able to write? I mean what stylus and pad are you using?

  • @aadityadabli
    @aadityadabli 4 роки тому

    Thank you Harry bhai👌🏻

  • @anmolsoni239
    @anmolsoni239 Рік тому

    6:52 Bhaiya agar digit ko append kare toh nhi chalega??

  • @ManishSharma-fi2vr
    @ManishSharma-fi2vr 4 роки тому +1

    Sir make videos on star patterns in C programming language

  • @coderrishav
    @coderrishav 4 роки тому +1

    Bhai ek dil dedo agar aap future mein ek AI game banaoge just like chess.

  • @NTTtv
    @NTTtv 4 роки тому

    are you using any external device for writing?

  • @dhavalsaxena9583
    @dhavalsaxena9583 3 роки тому

    nice sir

  • @bharathkumar132
    @bharathkumar132 4 роки тому

    def armstrongnumber(n):
    arm = 0
    for i in range(0,len(str)):
    arm = arm + int(str[i])**len(str)
    print(arm)
    if arm == int(str) :
    print("The Entered number is Armstrong number")
    else:
    print(f"The Entered number is not an Armstrong number as {arm} not equal to {int(str)}")
    if __name__ == '__main__':
    str = input("Enter a number:")
    armstrongnumber(str)
    # print(arm)

  • @aradhyanigammusic7117
    @aradhyanigammusic7117 4 роки тому

    Sir apne ek video mein bataya hai ki C IMO Hai But meine programming apki PYTHON FOR BEGINNERS se ....Ab mujhe kya karna chahiye
    PLZ PLZ AP REPLY DIJIYE🙏🏻🙏🏻🙏🏻

  • @CSKuldeepSingh
    @CSKuldeepSingh 4 роки тому +1

    Bhai ek problem hai kyoki mathematically 0 ki power 0 is equal to 1 hota hai fir ye Armstrong number kaise ho sakta hai.

  • @apaniduniya7283
    @apaniduniya7283 4 роки тому +1

    Sr kivy kab sikhavoge

  • @shiven7201
    @shiven7201 8 місяців тому

    thanku

  • @SamirKhan-bu4ct
    @SamirKhan-bu4ct 4 роки тому

    Thank you.
    Please Upload a video for installing visual studio.
    It will really be helpful for me.

    • @yourintrovertguy
      @yourintrovertguy 4 роки тому

      There is already a video on visual studio code.....

  • @sciencexdream7473
    @sciencexdream7473 4 роки тому

    Harry bhai Apne python biggener tutorial mein #59 mein abstraction and encapsulation ko switch kar diya hai . main vo playlist dekhra hun abhi main beginner hun..

  • @sourabhjain712
    @sourabhjain712 4 роки тому +1

    bro you are awesome

  • @Aditya-ve1ud
    @Aditya-ve1ud 2 роки тому +1

    I love the way when he told - samjha kar hi manunga.😂😂😂

  • @dyashwanth9822
    @dyashwanth9822 3 роки тому

    How to convert answer to list in an interval
    Like 1 to 100
    1
    2
    3...
    I want in [1,2,3..] ??

  • @yogendratripathi7753
    @yogendratripathi7753 Рік тому

    Great

  • @RohanDasRD
    @RohanDasRD 4 роки тому

    Awesome bro

  • @shishirpradhan2653
    @shishirpradhan2653 4 роки тому

    Uncle aap website mein commercial photos ke liye unplash aur pexels use karte hai. Aur ek website hai Pixbay. Uncle apko free commercial photos Pixbay se bhi milega

  • @nahiansporsho1016
    @nahiansporsho1016 4 роки тому

    Bruhh django ki pura tutorial ek video meye laake upload kardo please

  • @KunalKumar-tt4bt
    @KunalKumar-tt4bt 2 роки тому +1

    print(num, " ")

  • @nisheksharma7583
    @nisheksharma7583 4 роки тому

    harry bhai aap toh padha kar nikal jate ho,
    kabhi live session bhi kra kro
    QnA type

  • @vsstories-eo9ue
    @vsstories-eo9ue Рік тому

    1:41 was awesome 😅😅😅😂😂🤣🤣

  • @sujanshahi6819
    @sujanshahi6819 4 роки тому

    You're amazing Harry sir💖

  • @shubhayonbanik3857
    @shubhayonbanik3857 3 місяці тому

    Error hoga kyuki n toh 0 hogaya, btw love your video❤

  • @amitthakur7
    @amitthakur7 4 роки тому

    please make playlist on reactjs please you have created playlist of website development but reactjs is included in that so without reactjs its incomlete its necessary for web developer to learn reactjs also so please make reactjs playlist in hindi. i am searching for it so long but can't able to find a good teacher like you to make things easier to understand please please .
    from your fan and student.

  • @kushalchaurasia5609
    @kushalchaurasia5609 4 роки тому

    sir app kabhi unity 3d ka tutorial bnayenge

  • @iam.superaman
    @iam.superaman 3 роки тому

    Harry bhai you are op 🤣🤣 Binod Number wali baat pr hasi aa gai😄😂

  • @rajatyadaw8496
    @rajatyadaw8496 4 роки тому

    I have a question
    How to find angles between two lines with numpy. Please tell me

  • @rishurajsharma3130
    @rishurajsharma3130 4 роки тому

    Bhai Aapke har din 5000 subscribers badh rahe hai
    Congo
    You deserve a lot more

  • @bindassboss4620
    @bindassboss4620 4 роки тому

    thank you harry bhai for giving a wonderful course of python

  • @travelfreak18
    @travelfreak18 4 роки тому

    Harry bhai i have also a program can you please tell me how can i deliver to you for solution?