This repository has been archived on 2026-04-09. You can view files and clone it, but cannot push or open issues or pull requests.
practice2/main.py
2026-04-04 12:06:19 +03:00

25 lines
427 B
Python

# Практика
def is_armstrong(a):
true_a = a
armstrong = 0
count = len(str(a))
count2 = count
while count2!= 0:
armstrong = armstrong + ((a%10)** count)
a = a//10
count2-=1
if armstrong == true_a:
return True
return False
if __name__ == '__main__':
print("is_armstrong(153) - ", is_armstrong(153))
print("is_armstrong(10) - ", is_armstrong(10))