-
Notifications
You must be signed in to change notification settings - Fork 0
/
22_list_xor.py
31 lines (25 loc) · 953 Bytes
/
22_list_xor.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
"""
Challenge
List xor
Define a function named list_xor. Your function should take three parameters:
n, list1 and list2.
Your function must return whether n is exclusively in list1 or list2.
In other words, if n is in both lists or in none of the lists, return False.
If n is in only one of the lists, return True.
For example:
list_xor(1, [1, 2, 3], [4, 5, 6]) == True
list_xor(1, [0, 2, 3], [1, 5, 6]) == True
list_xor(1, [1, 2, 3], [1, 5, 6]) == False
list_xor(1, [0, 0, 0], [4, 5, 6]) == False
"""
"""
list_xor adında bir fonksiyon yazın.Fonksiyonunuz üç parametre almalı,
n, list1, list2
Fonksiyonunuz n sadece list1 veya list2 içerisinde var ise True dönmelidir.
Yani eğer n her iki listede de yoksa veya her iki listede de varsa False dönmelidir.
Mesela;
list_xor(1, [1, 2, 3], [4, 5, 6]) == True
list_xor(1, [0, 2, 3], [1, 5, 6]) == True
list_xor(1, [1, 2, 3], [1, 5, 6]) == False
list_xor(1, [0, 0, 0], [4, 5, 6]) == False
"""