ไม่สามารถเล่นวิดีโอนี้
ขออภัยในความไม่สะดวก

Python Program to Check Armstrong Number

แชร์
ฝัง
  • เผยแพร่เมื่อ 11 ส.ค. 2020
  • 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

ความคิดเห็น • 257

  • @CodeWithHarry
    @CodeWithHarry  4 ปีที่แล้ว +120

    Armstrong to theek hai lekin ye Binod kon hai?

  • @siddheshphadke3719
    @siddheshphadke3719 4 ปีที่แล้ว +31

    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 ❤️👍😊☺️

  • @thengc2676
    @thengc2676 2 ปีที่แล้ว +8

    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

  • @sangeetawadhwani5515
    @sangeetawadhwani5515 4 ปีที่แล้ว +15

    Harry bhai, you are a wonderful teacher and programmer

  • @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.

  • @vaibhavyadav8726
    @vaibhavyadav8726 3 ปีที่แล้ว +4

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

  • @bedifferent8166
    @bedifferent8166 3 ปีที่แล้ว +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

  • @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

  • @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")

  • @ruchirmandora4656
    @ruchirmandora4656 3 ปีที่แล้ว +1

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

  • @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 7 หลายเดือนก่อน

      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')

  • @yashwanthaas3233
    @yashwanthaas3233 2 ปีที่แล้ว +1

    Thank you very much!

  • @linujose2536
    @linujose2536 4 ปีที่แล้ว +2

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

  • @channelpro2284
    @channelpro2284 4 ปีที่แล้ว +1

    You are great genius coder.

  • @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")

  • @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.

  • @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.

  • @clashcloud5720
    @clashcloud5720 4 ปีที่แล้ว +1

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

  • @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.

  • @mercesletifer6625
    @mercesletifer6625 2 ปีที่แล้ว +1

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

  • @parthgupta4850
    @parthgupta4850 4 ปีที่แล้ว

    Harry bhai ur best programming teacher

  • @souravkumar7283
    @souravkumar7283 4 ปีที่แล้ว +2

    Perfect teaching skills 👌

  • @kedargalande3193
    @kedargalande3193 2 ปีที่แล้ว +1

    Very well explained!

  • @adityarathod6924
    @adityarathod6924 4 ปีที่แล้ว

    Harry Bhai ....love u....i was very obssessed with code when i first learn from another TH-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

  • @nareshgoyal1994
    @nareshgoyal1994 4 ปีที่แล้ว

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

  • @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")

  • @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

  • @Aditya-ve1ud
    @Aditya-ve1ud 2 ปีที่แล้ว +1

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

  • @itzjvs9052
    @itzjvs9052 4 ปีที่แล้ว

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

  • @hari_1357
    @hari_1357 3 หลายเดือนก่อน

    Thank you soooooo much!!

  • @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")

  • @adityajadhavar9675
    @adityajadhavar9675 4 ปีที่แล้ว

    Bohot achhe harry bhai.Please aise aur practice programs banaye

  • @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.

  • @coderrishav
    @coderrishav 4 ปีที่แล้ว +1

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

  • @Ammarkoka
    @Ammarkoka 4 ปีที่แล้ว +9

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

  • @rajuraghuwanshi2537
    @rajuraghuwanshi2537 2 ปีที่แล้ว +1

    perfect 👌👌

  • @siddharth840
    @siddharth840 2 ปีที่แล้ว

    thanks brother its help me a lot

  • @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

  • @nishishandilya
    @nishishandilya 3 ปีที่แล้ว +1

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

  • @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)))])

  • @sumeetnegi9934
    @sumeetnegi9934 3 ปีที่แล้ว

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

  • @kirandhumal1799
    @kirandhumal1799 ปีที่แล้ว

    Shukriya bhai ❤

  • @maheshappaji1273
    @maheshappaji1273 2 ปีที่แล้ว

    thank you

  • @sarenkumar6108
    @sarenkumar6108 2 ปีที่แล้ว

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

  • @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)

  • @rupamhari115
    @rupamhari115 4 ปีที่แล้ว

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

  • @Canon1521i
    @Canon1521i 4 ปีที่แล้ว +2

    Sir we are facing the errors in browser like "Failed to load resource: the server responded with a status of 404 (Not Found)"
    While doing the java script programs in VSCODE..!
    And our programs are not run bcz of this error.
    Plz let us tell how to fix it🙏🙏🙏🙏

    • @shishirpradhan2653
      @shishirpradhan2653 4 ปีที่แล้ว

      See Uncle this error comes when the address of the website is not found. You can fix this by verifying the address of the server

  • @schooldays5817
    @schooldays5817 4 ปีที่แล้ว

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

  • @aadityadabli
    @aadityadabli 4 ปีที่แล้ว

    Thank you Harry bhai👌🏻

  • @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......................

  • @akhalaqmonis4713
    @akhalaqmonis4713 4 ปีที่แล้ว

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

  • @technicalraxo5385
    @technicalraxo5385 4 ปีที่แล้ว

    Thanks so much sir

  • @sagarbanik911
    @sagarbanik911 4 ปีที่แล้ว +1

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

  • @codepotato1537
    @codepotato1537 4 ปีที่แล้ว

    good explanation harry

  • @ManishSharma-fi2vr
    @ManishSharma-fi2vr 4 ปีที่แล้ว +1

    Sir make videos on star patterns in C programming language

  • @0amritsingh
    @0amritsingh 4 ปีที่แล้ว

    thanks bhai

  • @prithvivirajgupta1282
    @prithvivirajgupta1282 3 ปีที่แล้ว

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

  • @codewithharryfanchannel559
    @codewithharryfanchannel559 4 ปีที่แล้ว

    Thank you sir.

  • @shivenduvimal193
    @shivenduvimal193 3 ปีที่แล้ว +1

    Sum = 0 , pehle mention krna kyon jaroori hai...Please reply

  • @bindassboss4620
    @bindassboss4620 4 ปีที่แล้ว

    thank you harry bhai for giving a wonderful course of python

  • @bhuwaneshchandra1379
    @bhuwaneshchandra1379 4 ปีที่แล้ว +1

    # Bhai maine bhi ek solution banaya hai wo bhi sahi answer de raha he ye mujhe zyada easy lag rha he
    def armstrong_detector(num):
    lst = []
    n = len(num)
    for i in num:
    try:
    lst.append(int(i)**n)
    except ValueError:
    print("Please provide a number.
    ")
    exit()

    if sum(lst)==int(num):
    return f"
    {num} is an armstrong number."
    else:
    return f"
    {num} is not an armstrong number."

    if __name__ == "__main__":
    number = input("Enter a number.
    ")
    print(armstrong_detector(number))

  • @ron_stark4179
    @ron_stark4179 4 ปีที่แล้ว +1

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

  • @shiven7201
    @shiven7201 6 หลายเดือนก่อน

    thanku

  • @iam.superaman
    @iam.superaman 3 ปีที่แล้ว

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

  • @sourabhjain712
    @sourabhjain712 4 ปีที่แล้ว +1

    bro you are awesome

  • @RohitKumar-go2is
    @RohitKumar-go2is 4 ปีที่แล้ว

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

  • @SomneelMaity
    @SomneelMaity 4 ปีที่แล้ว

    please post more python programs like this

  • @NTTtv
    @NTTtv 4 ปีที่แล้ว

    are you using any external device for writing?

  • @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

  • @yogendratripathi7753
    @yogendratripathi7753 ปีที่แล้ว

    Great

  • @vsstories-eo9ue
    @vsstories-eo9ue ปีที่แล้ว

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

  • @RohanDasRD
    @RohanDasRD 4 ปีที่แล้ว

    Awesome bro

  • @dhavalsaxena9583
    @dhavalsaxena9583 2 ปีที่แล้ว

    nice sir

  • @mightyit7483
    @mightyit7483 4 ปีที่แล้ว

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

  • @sujanshahi6819
    @sujanshahi6819 4 ปีที่แล้ว

    You're amazing Harry sir💖

  • @khanmujtaba1887
    @khanmujtaba1887 4 ปีที่แล้ว

    Amazing sir thank you

  • @anonymusk9397
    @anonymusk9397 4 ปีที่แล้ว +1

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

  • @user-sj4mw9fi9k
    @user-sj4mw9fi9k 4 ปีที่แล้ว

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

  • @rishurajsharma3130
    @rishurajsharma3130 4 ปีที่แล้ว

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

  • @siddheshphadke3719
    @siddheshphadke3719 4 ปีที่แล้ว +1

    Problem is the variable n is not the original one as we have modified it in while loop

  • @rohanbeast3381
    @rohanbeast3381 3 ปีที่แล้ว

    def armstrong_checker(number:int):
    ls = []
    ls2 = []
    for item in str(number):
    ls.append(int(item))
    for item2 in ls:
    ls2.append(item2 ** len(ls))
    if sum(ls2) == number:
    print("It is an Armstrong Number!")
    else:
    print("It is not an Armstrong number")
    if __name__ == '__main__':
    inp = int(input("Enter your Number: "))
    armstrong_checker(inp)

  • @nikhilraj1842
    @nikhilraj1842 4 ปีที่แล้ว +2

    1:42 Harry Bhai mic ko kya hua tha

  • @vikaskatke3
    @vikaskatke3 4 ปีที่แล้ว

    Thank you brother 🙏👍

  • @SamirKhan-bu4ct
    @SamirKhan-bu4ct 4 ปีที่แล้ว

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

    • @sagarbanik911
      @sagarbanik911 4 ปีที่แล้ว

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

  • @technicalraxo5385
    @technicalraxo5385 4 ปีที่แล้ว

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

  • @machhindrasmathematics2551
    @machhindrasmathematics2551 ปีที่แล้ว

    Make video on anagram of strings

  • @fusion__gaming
    @fusion__gaming 4 ปีที่แล้ว +1

    Please give us your discord server link sir. It a request. If you dont have discord server so i am very helpful to make a discord server for you.

  • @nisheksharma7583
    @nisheksharma7583 4 ปีที่แล้ว

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

  • @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..] ??

  • @rajatyadaw8496
    @rajatyadaw8496 4 ปีที่แล้ว

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

  • @anmolsoni239
    @anmolsoni239 ปีที่แล้ว

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

  • @Sampoorna.
    @Sampoorna. ปีที่แล้ว

    Can this be done with for loop???

  • @promakanungoe8294
    @promakanungoe8294 4 ปีที่แล้ว

    Please make tutorial for java...mostly needed.

  • @rajrajaparmar7138
    @rajrajaparmar7138 4 ปีที่แล้ว

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

  • @freefirevibes1318
    @freefirevibes1318 3 ปีที่แล้ว

    Find a maximum armstrong number in a given number.
    Example: 1211531634121
    Possible armstrong numbers: [153, 1634]
    Output: 1634
    Any one know

  • @vanshikashah3013
    @vanshikashah3013 4 ปีที่แล้ว

    Yes variable kisi or value me save karna padega

  • @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..

  • @adamsaleh8018
    @adamsaleh8018 4 ปีที่แล้ว

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

  • @Hi_kartik
    @Hi_kartik 3 ปีที่แล้ว

    # this is programmer to calalate the armstrong number
    # author = kartik☻
    import math
    number = (input("Enter the number"))
    len_of_number = len(str(number))
    # print(len_of_number)
    total = 0
    for i in (number):
    i = int(i)
    power = i ** int(len_of_number)
    # or
    # power = math.pow(i,int(len_of_number))
    total = total + power
    number = int(number)
    total = int(total)
    if number == total:
    print(f"This is armstorng number {number}")
    else:
    print("this is not armstrong number ")

  • @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.