forked from souravjain540/Basic-Python-Programs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request souravjain540#37 from DEBOBANI/main
Automorphic Number
- Loading branch information
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
print("Enter the number you want to check:") | ||
num=int(input()) | ||
square=num*num | ||
flag=0 | ||
while(num>0): | ||
if(num%10!=square%10): | ||
print("No, it is not an automorphic number.") | ||
flag=1 | ||
break | ||
|
||
num=num//10 | ||
square=square//10 | ||
if(flag==0): | ||
print("Yes, it is an automorphic number.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
def Remove(duplicate): | ||
final_list = [] | ||
for num in duplicate: | ||
if num not in final_list: | ||
final_list.append(num) | ||
return final_list | ||
duplicate = [2, 4, 10, 20, 5, 2, 20, 4] | ||
print(Remove(duplicate)) |