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

Поделиться
HTML-код
  • Опубликовано: 12 сен 2024
  • In this video, learn Python Program to Check If the Number is Armstrong or Not? Find all the videos of the 100+ Python Programs Course in this playlist: • Python Program to Add ...
    💎 Get Access to Premium Videos and Live Streams: / @wscubetech
    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.
    👉For Digital Marketing services (Brand Building, SEO, SMO, PPC, SEM, Content Writing), Web Development and App Development solutions, visit our website: www.wscubetech...
    👉Want to learn new skills and improve existing ones with in-depth and practical sessions? Enroll in our advanced online courses now and make yourself job-ready: courses.wscube...
    All the courses are job-oriented, up-to-date with the latest algorithms and modules, fully practical, and provide you hands-on projects.
    👉 Want to learn and acquire skills in English? Visit WsCube Tech English channel: bit.ly/2M3oYOs
    📞 For more info about the courses, call us: +91-7878985501, +91-9269698122
    ✅ CONNECT WITH THE FOUNDER (Mr. Kushagra Bhatia) -
    👉 Instagram - / kushagrabhatiaofficial
    👉 LinkedIn - / kushagra-bhatia
    Connect with WsCube Tech on social media for the latest offers, promos, job vacancies, and much more:
    ► Subscribe: bit.ly/wscubech...
    ► Facebook: / wscubetech.india
    ► Twitter: / wscubetechindia
    ► Instagram: / wscubetechindia
    ► LinkedIn : / wscubetechindia
    ► RUclips: / wscubetechjodhpur
    ► Website: wscubetech.com
    -------------------------------------| Thanks |--------------------------
    #python #pythontutorials #pythonprogramming

Комментарии • 35

  • @wscubetech
    @wscubetech  2 года назад +6

    😎Hey, thanks for watching! We’d love to know your thoughts/doubts here in the comments.
    👉For professional self-paced certification courses (pre-recorded), visit: bit.ly/Pre-Recorded-Course
    👉Don’t forget to SUBSCRIBE to our channel for more such videos & valuable content: bit.ly/RUclips-WsCubeTech

  • @user-ic3xc1hu3v
    @user-ic3xc1hu3v 10 месяцев назад +9

    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

  • @Riya-pf3oc
    @Riya-pf3oc Год назад +4

    Beautiful explanation. Thanks so much

  • @PythonProjectSolver
    @PythonProjectSolver 8 месяцев назад +1

    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
      @PythonProjectSolver 8 месяцев назад

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

  • @sushantchougale6818
    @sushantchougale6818 2 года назад +4

    Thank you very much Madam 😊 🙏🏻🙏🏻🙏🏻🙏🏻

  • @bukkepradeepnaik7826
    @bukkepradeepnaik7826 Год назад +1

    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)

    • @PythonProjectSolver
      @PythonProjectSolver 8 месяцев назад +1

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

  • @user-xq2du4qh4r
    @user-xq2du4qh4r 11 месяцев назад

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

  • @UmeshKumar-uy6we
    @UmeshKumar-uy6we 8 месяцев назад +1

    def armstrong_number(number):
    alpha=sum(int(item)**len(str(number))for 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

    • @Prashantchaudhary-kf1fb
      @Prashantchaudhary-kf1fb 7 месяцев назад

      i copy paste your code but it can not run i click run then automatically shifted in another cell

    • @Mridun29811
      @Mridun29811 26 дней назад

      define(def) statement is used to define a function

  • @77Aditya77
    @77Aditya77 Год назад +4

    Mam ye sirf 3 digit ke liye applicable hai na ?

    • @hotshow3691
      @hotshow3691 Год назад +1

      convert input value into string then get the length of it and store in a variable then use this variable instead of 3..
      emiway bantai:::: Samaj main aya kya..

    • @aishwaryabhalbhar7774
      @aishwaryabhalbhar7774 Год назад +2

      u can use (len(str(num))) instead of 3

  • @maroofkhan5558
    @maroofkhan5558 10 месяцев назад +10

    so confusing please make more simple explanation

  • @user-vk3lx3cj8y
    @user-vk3lx3cj8y Год назад +1

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

  • @kocengineering769
    @kocengineering769 2 года назад +4

    Yes i didn't know what is Armstrong number

  • @Vikas_27_vlog_panti
    @Vikas_27_vlog_panti Год назад +1

    nice madam ji aap ki voice bahot achhi hai thanks

  • @manisofat2047
    @manisofat2047 8 месяцев назад +1

    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

  • @facebookapp521
    @facebookapp521 2 года назад +1

    Hello sales funnel kaise bnaue video bna do please 🙏

  • @mdkashifmeardad1946
    @mdkashifmeardad1946 2 года назад +2

    Thinks mam

  • @kashmirking2446
    @kashmirking2446 10 месяцев назад +1

    But why sum =0

  • @easycoder918
    @easycoder918 9 месяцев назад

    Thank you 😊 didi😊🎉

  • @harshitsrivastava5399
    @harshitsrivastava5399 4 месяца назад

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

  • @justplay2639
    @justplay2639 6 месяцев назад

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

  • @AdarshYadav-dd2gq
    @AdarshYadav-dd2gq 6 месяцев назад

    Har baar cube hi nahi hoga .

  • @manishbhatt5355
    @manishbhatt5355 9 месяцев назад

    Sooo confusing

    • @PythonProjectSolver
      @PythonProjectSolver 8 месяцев назад

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