PYTHON 3. Write code using zip and filter so that these lists (l1 and l2) are combined into one big list and assigned to the variable opposites if they are both longer than 3 characters each.
l1 = ['left', 'up',
'front']
l2 = ['right', 'down', 'back']
![11,12 = [left, up, front],[right, down, back) #Listl and List2 are defined here bigger list = zip(li, 12) #This f](http://img.homeworklib.com/questions/ada06c60-d363-11ea-9558-d3ae721ca654.png?x-oss-process=image/resize,w_560)
Output
![bbhishek@CAIR:-/Desktops python3 pp.py [(left, right), (front, back)]](http://img.homeworklib.com/questions/ae39f350-d363-11ea-ad30-b314ba478c7a.png?x-oss-process=image/resize,w_560)
PYTHON 3. Write code using zip and filter so that these lists (l1 and l2) are...
Question 3 (13] (a) Write a procedure filter (L,PredName, L1,L2) that accepts a list L and returns two lists Li and L2, where Li contains all elements in L for which PredName (x) fails, and L2 contains all elements in L for which PredName (x) succeeds. The predicate PredName/1 should be defined when calling the procedure filter. For example: let test be defined as test(N).- N > 0. 7- filter((-6,7,-1,0),test,L1,L2). L1 - (-6.-1) L2 - [7, 0] NB Use the...
Given two sorted lists, L1 and L2, write a procedure to computeL1 ∪ L2 using only the basic list operations.
PYTHON QUESTION
2. Write a function called first_day_greater that takes two lists, L1 and L2 , representing the daily measured weights of rat 1 and rat 2, respectively, and returns the index of the first day for which the weight for the fist rat is greater than the weight of the second rat.If there are no such days then the function should return -1. You may NOT assume that L1 and L2 are the same length. Use the following to...
1)Given two lists L1 and L2, create a new list L3 consisting of the first element of L1 and the last element of L2. For example, if L1=[1,2,3] and L2=["a","b","c"], L3 should be [1,"c"] 2)given a string s, create a new string odd_letters that contains only the odd letters of s (two ways to solve this problem are to use slicing, or a while or for loop), i.e. starting at the first letter or the zeroth index: if s="banana", odd_letters...
PYTHON 3 LANGUAGE , LINKED LISTS , define function ITERATIVELY Define an iterative function named alternate_i; it is passed two linked lists (ll1 and ll2) as arguments. It returns a reference to the front of a linked list that alternates the LNs from ll1 and ll2, starting with ll1; if either linked list becomes empty, the rest of the LNs come from the other linked list. So, all LNs in ll1 and ll2 appear in the returned result (in the...
C# code Arrays and Linked Lists: Write C++/Java/C#/Python code to declare an array of linked lists of any primitive type you want. (Array of size 2020) (This could be based on MSDN libraries or the lab) – you do not need to instantiate any of the linked lists to contain any actual values. Paste your code for that here (this should only be one line) Based on your code or the lab from 4 or your doubly linked list from...
IN PYTHON: Write a function that takes, as arguments, two lists, one of which is a character list and the other is the corresponding frequencies, and sorts the characters in ascending order of frequencies. The function should return a list consististing of two lists: the first list is the list of characters and the second is the list of corresponding frequencies, consistent with the rearranged characters. Name this function sortCharacters(characterList, frequencyList). For example, >>>sortCharacters(["a", "b", "c", "d"], [5, 8, 3,...
1. Please write the following in Python 3 code. Also, write code and not psedo code. Also, show all outputs and share your code. Question: Create one conditional so that if “Friendly” is in w, then “Friendly is here!” should be assigned to the variable wrd. If it’s not, check if “Friend” is in w. If so, the string “Friend is here!” should be assigned to the variable wrd, otherwise “No variation of friend is in here.” should be assigned...
1. Please write the following code in Python 3. Also, please write code and not psedo-code. 2. Please also share your code and show all outputs. Write code that uses the string stored in org and creates an acronym which is assigned to the variable acro. Only the first letter of each word should be used, each letter in the acronym should be a capital letter, and there should be nothing to separate the letters of the acronym. Words that...
Using Python latest version. 4. File Name: usernameListMe a. In this file, write the code to create a python list of strings that are 4 classes that are offered in the ICT program like "ict463" . b. Then create a list of 4 classes that are Gen-ED courses like "math121". c. Write the code to concatenate the lists into a third variable. d. Add a line of code to add one more Gen-ED course to the third - concatenated variable. e.Add...