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

  Рет қаралды 68,926

WsCube Tech

WsCube Tech

Күн бұрын

Пікірлер: 43
@wscubetech
@wscubetech 2 жыл бұрын
😎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/KZbin-WsCubeTech
@Nannu-l4i
@Nannu-l4i Жыл бұрын
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
@Krishna_vasudeva
@Krishna_vasudeva Жыл бұрын
Thanks
@itsveronica...
@itsveronica... 3 ай бұрын
awesome bro thanks a lot dude
@Riya-pf3oc
@Riya-pf3oc Жыл бұрын
Beautiful explanation. Thanks so much
@sushantchougale6818
@sushantchougale6818 2 жыл бұрын
Thank you very much Madam 😊 🙏🏻🙏🏻🙏🏻🙏🏻
@cdhaifule
@cdhaifule 4 ай бұрын
Wonderful detailed explanation. Thanks
@maroofkhan5558
@maroofkhan5558 Жыл бұрын
so confusing please make more simple explanation
@x_moonboy
@x_moonboy 7 ай бұрын
-ve iq ?
@ArshadAli-yh7dv
@ArshadAli-yh7dv 6 ай бұрын
@@x_moonboy it is also wrong
@aashpay
@aashpay 9 күн бұрын
No
@SupriyaKulkarni-b6j
@SupriyaKulkarni-b6j Жыл бұрын
very nice teaching. I understood very well. Your logic is simple but clear. This is the quality of good programmer.
@bukkepradeepnaik7826
@bukkepradeepnaik7826 Жыл бұрын
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 Жыл бұрын
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")
@sujanangadi6301
@sujanangadi6301 Ай бұрын
a = "407" j = 0 for i in range(len(a)): h = a[i] c = int(h) ** 3 j += c if (j == int(a)): print(a, "is an armstrong number") else: print(a, "its not armstrong")
@UmeshKumar-uy6we
@UmeshKumar-uy6we Жыл бұрын
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 Жыл бұрын
i copy paste your code but it can not run i click run then automatically shifted in another cell
@Mridun29811
@Mridun29811 5 ай бұрын
define(def) statement is used to define a function
@77Aditya77
@77Aditya77 Жыл бұрын
Mam ye sirf 3 digit ke liye applicable hai na ?
@hotshow3691
@hotshow3691 Жыл бұрын
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 Жыл бұрын
u can use (len(str(num))) instead of 3
@Truple64
@Truple64 2 ай бұрын
​@@aishwaryabhalbhar7774 Thank you!!
@REKHAMEHTA-v6c
@REKHAMEHTA-v6c Жыл бұрын
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")
@REKHAMEHTA-v6c
@REKHAMEHTA-v6c Жыл бұрын
is this correct??
@shravanikeni6218
@shravanikeni6218 Жыл бұрын
No
@yadavji-d3w
@yadavji-d3w Жыл бұрын
yes
@kocengineering769
@kocengineering769 2 жыл бұрын
Yes i didn't know what is Armstrong number
@Random_Coder727
@Random_Coder727 28 күн бұрын
def define_amstrong_value(a): a = str(a) x = 0 for i in a: i = int(i) x = x + i**3 return x num = int(input('upto where you want amstg nums?: ')) for i in range(1,num+1): if i == define_amstrong_value(i): print(i)
@Random_Coder727
@Random_Coder727 28 күн бұрын
it prints all the amstrong nums upto which you want
@sweet_girl_23
@sweet_girl_23 Ай бұрын
print(sum(int(i)**len(n)) for i in str(n))
@manisofat2047
@manisofat2047 Жыл бұрын
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
@PythonProjectSolver
@PythonProjectSolver Жыл бұрын
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 Жыл бұрын
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")
@kashmirking2446
@kashmirking2446 Жыл бұрын
But why sum =0
@Vikas_27_vlog_panti
@Vikas_27_vlog_panti Жыл бұрын
nice madam ji aap ki voice bahot achhi hai thanks
@easycoder918
@easycoder918 Жыл бұрын
Thank you 😊 didi😊🎉
@mdkashifmeardad1946
@mdkashifmeardad1946 2 жыл бұрын
Thinks mam
@harshitsrivastava5399
@harshitsrivastava5399 8 ай бұрын
This program is wrong mam it will not work for any no which has greater than 3 digits.
@facebookapp521
@facebookapp521 2 жыл бұрын
Hello sales funnel kaise bnaue video bna do please 🙏
@AdarshYadav-dd2gq
@AdarshYadav-dd2gq 10 ай бұрын
Har baar cube hi nahi hoga .
@justplay2639
@justplay2639 10 ай бұрын
why its not working if i am not using temp variable either of it i am directly using num on its place
@manishbhatt5355
@manishbhatt5355 Жыл бұрын
Sooo confusing
@PythonProjectSolver
@PythonProjectSolver Жыл бұрын
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")
Python Program to Check Armstrong Number
18:08
CodeWithHarry
Рет қаралды 104 М.
🎈🎈🎈😲 #tiktok #shorts
0:28
Byungari 병아리언니
Рет қаралды 4,5 МЛН
Program To Check for Armstrong Number in Java by Deepak
16:11
Smart Programming
Рет қаралды 334 М.
Solve any Star Pattern program in Python
18:44
Simply Coding
Рет қаралды 1 МЛН
Python Program #17 - Check Armstrong Number in Python
8:44
Programming For Beginners
Рет қаралды 16 М.
Python Armstrong Number Program - In Hindi
18:17
codeitup
Рет қаралды 48 М.
Fibonacci Sequence: Python Tutorial for Beginners
9:20
WsCube Tech
Рет қаралды 73 М.
Python Program To Check Whether A Number Is A Palindrome Or Not
9:53
Solve any Series Program in Python
20:15
Simply Coding
Рет қаралды 47 М.