Skip to content

Commit 703b6a6

Browse files
author
Sagar Paul
committed
___
1 parent a668531 commit 703b6a6

File tree

3 files changed

+33
-1
lines changed

3 files changed

+33
-1
lines changed

DSA-problems/02.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
n = int(input("Enter upto which digit you want to find Angstrom number: "))
2+
3+
for i in range(1,n+1):
4+
l = len(str(i))
5+
result = 0
6+
a = str(i)
7+
for j in range(l):
8+
result = result + int(a[j])**l
9+
if result == i:
10+
print(i)
11+
12+
13+
14+

Python Problem Solving/01_Armstrong Numbers 1 to 1000.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,22 @@
88
i = i//10
99
if num == result:
1010
print(result)
11-
11+
12+
13+
'''
14+
15+
16+
n = int(input("Enter upto which digit you want to find Angstrom number: "))
17+
18+
for i in range(1,n+1):
19+
l = len(str(i))
20+
result = 0
21+
a = str(i)
22+
for j in range(l):
23+
result = result + int(a[j])**l
24+
if result == i:
25+
print(i)
26+
27+
28+
'''
29+

Python Problem Solving/45_.py

Whitespace-only changes.

0 commit comments

Comments
 (0)