Here is my code :
evenorodd=[1,2,3]
list1=['a','b','c']
list2=['A','B','C']
res = tuple(map(lambda x: True if x % 2 != 0 else False, evenorodd))
print(res)
the output:
(False, True, False, True)
I want this : element of list1 if x%2!=0 (if element of evenorodd is odd) element of list2 else (if element of evenorodd is even) The output that I look for:
('a','B','c')
and I want to do that on one line
res = tuple(map(lambda x: ??? if x % 2 != 0 else ???, evenorodd))
Thank you