Find the Number is Armstrong or Not | Python Interview Questions in Telugu
ฝัง
- เผยแพร่เมื่อ 11 ก.ย. 2024
- GitHub link:
github.com/kir...
Instagram-link:
www.instagram....
Facebook link:
/ python-life-telugu-107...
linkedin:
/ kiran-sagar-a00a761b2
Telegramlink:
t.me/python_li...
n=int(input("enter a number :"))
s=str(n)
sum=0
for i in range(0,len(s)):
sum=sum+(int(s[i]))**3
if(n==sum):
print("{} is armstrong number".format(n))
else:
print("{} is not a armstrong number".format(n))
Ee problem ni if else statement and indexing use chesi kooda cheyochu kadha bro...
Number = input("153")
Length = len(number)
First_digit = int(Number[0])
Second_digit =int(Number[1])
Third_digit =int(Number [2])
Armstrong_number = first_digit ** length + second_digit ** length + third_digit ** length
If Armstrong_number == Number:
Print("Armstrong Number")
else:
Print ("Normal Number")
Cheyochu
Okavela n digit number ni dynamic ga input ivvalante ee method work avvadhu
Annaya meeru chala baga cheptunaru nenu python nerchukuntunna ms office vachu naku kani python nerchukuntey manchi future vuntundi ani nerchukuntunna kani first last baganey rastunna kani middle part potundi logic miss avutunna aah logic ela ardam chesukovali code ela rayalo suggestion ivandi anna
❤
Good Explanation.
Anna windows 7 [32-bit computer] lo oka python compiler cheppu anna
Tq anna
3**3=27
Paina code lo manam 10 ee enduku teskunnam veredi tesoludadaa.. Ah? 03:57
manam eh num ni iyna 10 tho mod cheyste manaki last digit reminder laga ostadi so seperate num ni cube cheyochu .