This file contains hidden or 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
def find_anagrams(list_of_words, word): | |
sliced_word = [] | |
sliced_word += word | |
list_of_anagrams = [] | |
for element in list_of_words: | |
sliced_element = [] | |
sliced_element += element | |
if sorted(sliced_element) == sorted(sliced_word): | |
list_of_anagrams.append(element) | |
return list_of_anagrams |
This file contains hidden or 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
big_num = '7316717653133062491922511542828064444866452387493035890' | |
big_num_len = len(big_num) | |
list_of_products = [] | |
def multiply_adjacents(adj_num): | |
product = 0 | |
first_pos = True | |
for element in adj_num: |
This file contains hidden or 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
def is_prime(n): | |
prime = False | |
for divisor in range(2, n): | |
if n % divisor == 0: | |
return prime | |
else: | |
continue | |
prime = True | |
return prime |
NewerOlder