Please, i need help with this coding question in python 1. lst1 = ['1', '2', [3]] 2. lst2 = [('3', 4), '5', 6] 3
Posted: Fri Jul 01, 2022 5:45 am
Please, i need help with this coding question in python
1. lst1 = ['1', '2', [3]]
2. lst2 = [('3', 4), '5', 6]
3. Join lst1 and lst2 soonly unique string or integer values remain in a newlist, lst3.(i.e., ['1', '2', 3, '3', 4, 5, 6])
4. Create an empty dictionarycalled odds_evens. Next, iteratethrough lst3. If a number (regardless of datatype) iseven, add the value to a list that will be stored as a value forthe key even in thedictionary, odds_evens. Do the same for the oddsnumbers. When you printthe odds_evens dictionary the output should looklike this: {'evens': ['2', 4, 6], 'odds': ['1', '3', 3, '5']}
1. lst1 = ['1', '2', [3]]
2. lst2 = [('3', 4), '5', 6]
3. Join lst1 and lst2 soonly unique string or integer values remain in a newlist, lst3.(i.e., ['1', '2', 3, '3', 4, 5, 6])
4. Create an empty dictionarycalled odds_evens. Next, iteratethrough lst3. If a number (regardless of datatype) iseven, add the value to a list that will be stored as a value forthe key even in thedictionary, odds_evens. Do the same for the oddsnumbers. When you printthe odds_evens dictionary the output should looklike this: {'evens': ['2', 4, 6], 'odds': ['1', '3', 3, '5']}