Created
September 17, 2021 09:54
-
-
Save droidjahangir/245502f026b25a9dcdad525fdeb6027c to your computer and use it in GitHub Desktop.
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
lst = [] | |
primeNumberList = [] | |
# input from user | |
lst = [int(item) for item in input("Enter the list items : ").split(",")] | |
# check prime number | |
def prime(n): | |
if n <= 0: | |
return "Not defined" | |
elif n == 1: | |
return "Not prime" | |
for i in range(2, n): | |
if n%i == 0: | |
return "not prime" | |
return "prime" | |
def list_prime(lst): | |
prime_list =[ ] | |
for i in lst: | |
x = prime(i) | |
if x == "prime": | |
prime_list.append(i) | |
return prime_list | |
primeNumberList = list_prime(lst) | |
# find sum | |
sumValue = sum(primeNumberList) | |
print(lst) | |
print(primeNumberList) | |
checksum = prime(sumValue) | |
if checksum == 'prime': | |
print("It's miracle!!!") | |
else: | |
print("Just another normal day!!!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment