Skip to content

Commit 7fc74ce

Browse files
Merge pull request #37 from DEBOBANI/main
Automorphic Number
2 parents 88b3c22 + 5ed3e07 commit 7fc74ce

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

automorphic.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
print("Enter the number you want to check:")
2+
num=int(input())
3+
square=num*num
4+
flag=0
5+
while(num>0):
6+
if(num%10!=square%10):
7+
print("No, it is not an automorphic number.")
8+
flag=1
9+
break
10+
11+
num=num//10
12+
square=square//10
13+
if(flag==0):
14+
print("Yes, it is an automorphic number.")

duplicates.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
def Remove(duplicate):
2+
final_list = []
3+
for num in duplicate:
4+
if num not in final_list:
5+
final_list.append(num)
6+
return final_list
7+
duplicate = [2, 4, 10, 20, 5, 2, 20, 4]
8+
print(Remove(duplicate))

0 commit comments

Comments
 (0)