Created
March 26, 2020 21:27
-
-
Save DjaPy/ff594f76d760770927f870443ff2f870 to your computer and use it in GitHub Desktop.
ya_back
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
def get_intersection_arrays(arr_1: list, arr_2: list) -> list: | |
st_1 = set(arr_1) | |
st_2 = set(arr_2) | |
return list(st_1 & st_2) | |
lst_1 = [1, 2, 3, 4, 5, 6] | |
lst_2 = [2, 4, 6, 8] | |
result_intersection = get_intersection_arrays(lst_1, lst_2) | |
print(result_intersection) | |
def del_zero(lst: list) -> list: | |
lst = list(set(lst)) | |
del lst[0] | |
return lst | |
arr = [1, 0, 3, 2, 0, 4, 0, 5, 0] | |
print(del_zero(arr)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment