Question: PYTHON 3.0 HELP!! NOT JAVA 1 .Given the lists list1 and list2, not necessarily of the same length, create a new list consisting of alternating
PYTHON 3.0 HELP!! NOT JAVA
1.Given the lists list1 and list2, not necessarily of the same length, create a new list consisting of alternating elements of list1 and list2 (that is, the first element of list1 followed by the first element of list2, followed by the second element of list1, followed by the second element of list2, and so on. Once the end of either list is reached, no additional elements are added. For example, if list1 contained [1, 2, 3] and list2 contained [4, 5, 6, 7, 8], then the new list should contain [1, 4, 2, 5, 3, 6]. Associate the new list with the variable list3.
2.Given:
a variable current_members that refers to a list, and
a variable member_id that has been defined.
Write some code that assigns True to a variable is_a_member if the value associated with member_id can be found in the list associated with current_members, but that otherwise assigns False to is_a_member. Use only current_members, member_id, and is_a_member.
3.Given the lists, lst1 and lst2, create a new sorted list consisting of all the elements of lst1 that do not appear in lst2 together with all the elements of lst2 that do not appear in lst1. For example, if lst1 is [4, 3, 2, 6, 2] and lst2 is [1, 2, 4, 1, 5], then the new list would be [1, 1, 3, 5, 6]. Note that duplicate elements are also duplicated in the new list. Associate the new list with the variable new_list, and don't forget to sort the new list.
4.Given the list my_list containing integers, create a list consisting of all the even elements of my_list. Associate the new list with the variablenew_list.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
