Write a function named listReplace that takes 3 arguments: list1, tuple1, and tuple2. The function then searches for entries of tuple1 in list1 and replaces them with the corresponding entries in tuple2 and returns the new list. For example, listReplace( [1,2,3,2,4,1,5], (1,2), (7,8)) will return the following list, replacing all 1s in list1 with 7, and all 2s with 8: [7,8,3,8,4,7,5] Be carefull the following call listReplace( [1,1,1,8,0,0], (1,0), (0,2) ) should return [e,0,0,2,2,2] and not [2,2,2,2,2, 2]. Also listReplace([1,1,1], (,2), (4,5)) returns the original list, because 0 and 2 do not exist in list1
Q: What are the uses of DEFINE and DESCRIBE? Please expand and elaborate. DEFINE uses: DESCRIBE ...
A: Answer: DEFINE uses: Define means to precisely describe or state the nature, scope, or meaning of so...
Q: b) When does the best case and worst-case complexity occurs in Quick sort? Explain it with the help ...
A: Quick sort is the fastest way of sorting elements in the list. Here in this sorting algorithm, one e...
Q: Fill in the empty spaces in the following table and be aware of the following: All answers must have...
A: For a 2's complement binary bit, if number is positive the 2's complement number will be same as 16 ...
Q: You are given the definition of the recursive method myFun. Show what would be returned by the follo...
A: a) System.out.println(myFun(-5)); Ans: -10 Explanation: According to the first base condition of myF...
Q: Create a program that allows you to view and edit the sales amounts for each month of the current ye...
A: the answer is given below:-
Q: What are the advantages of using data modelling?
A: Advantage of data modelling
Q: Write, compile, and test the Comments class that uses the command window to display the following st...
A: Here is the detailed explanation of the code.
Q: ay thi
A: Explanation: The storage architecture of your system is an important part of data transit and acces...
Q: public class Bicycle { public int cadence; private int gear; protected int speed; int id; public sta...
A: Explanation: The reason for the below options are is that instance variables are those fields that ...
Q: What are the fundamental operations of a linked list and the main advantage of a linked list over an...
A: the answer is given below:- by bartleby guidelines i am able to only first question.
Q: Is there a difference between a system subsystem and a logical division?
A: The subsystem is where work is processed on the system. A subsystem is a single, predefined operatin...
Q: If you have previous experience troubleshooting wireless LAN's, give an example of a scenario you ha...
A: NOTE :- Below i explain the answer in my own words by which you understand it well. Wireless ne...
Q: What are the main four different between Nmap and Hping3 with example ?
A: What are the main four different between Nmap and Hping3 with example ?
Q: SELECT ALL of the valid statements that instantiate an object from the Bicycle class shown below
A: Valid statements are: cadence gear setCadence setGear
Q: https://www.youtube.com/watch?v=Rtc0eeh1pSs&t=5318s What is deep data? Briefly explain about it. G...
A: Deep data or information alludes to huge information that is of top notch, important, and noteworthy...
Q: Show how the Splaying techniques (Zig, Zag, Zig-Zag, Zag-Zig, Zig-Zig, Zag- Zag) works in Splay Tree...
A: Zig: The Zig Rotation in the splay tree is similar to the single right rotation in AVL Tree rotation...
Q: How can a user establish a connection to a cloud storage system?
A: Introduction: A cloud storage system is one in which digital data is saved on the internet rather th...
Q: Requirements engineering is a discipline that involves establishing and documenting requirements. Va...
A: Requirements engineering is a discipline that involves establishing and documenting requirements. Va...
Q: uniform scaling and differential scaling
A: Uniform Scaling occurs when Sx and Sy are equal. If the values are not equal, the process is known a...
Q: What are the most pressing email security issues
A: Introduction: The most serious security problems concerning email communications security,
Q: What do assembly language instructions like MIV signify, and what are they called?
A: Introduction: Assembly language instructions. The designer can program in assembly language in terms...
Q: A multicore computer is a computer that has a lot of different parts.
A: A multicore computer is a computer that has a lot of different parts.
Q: What language does the CPU speak?
A: the answer is given below:-
Q: The set of all classes and their relationships (i.e., the set of all inheritance chains taken collec...
A: INTRODUCTION: A class is an expandable program-code-template for constructing objects in object-ori...
Q: Discuss a situation in which you’ve encountered difficulty understanding data (Information). What ar...
A: What are the problems to understand the data The structure The size The dimensions (in some cases ...
Q: When is it most appropriate to do a binary search?
A: 1) Binary Search is a searching algorithm used in a sorted array by repeatedly dividing the search i...
Q: How do you check the temperature of the CPU?
A: The answer is given below:-
Q: What is the function of a router in networking?
A: First, let's know about the router a little bit. Then we will know about the function of router. A r...
Q: Define function sumProduct that receives a list of numbers and returns a pair, where the first compo...
A: Logic:- define function sumProduct which takes lst as parameter. Set sum=0, product =1 Iterate for...
Q: Using Java script Find the sum and average of an unknown number of strictly positive (i.e. non-zero)...
A: Answer :
Q: What exactly is the distinction between Stored Procedures and Scripts? What is the function of each?...
A: Introduction: A stored procedure (also known as a proc, storp, sproc, StoPro, StoredProc, StoreProc,...
Q: hen you think about data backup and recovery, what are some of the most important things to think ab...
A: ANSWER:- The ability to restore data from an earlier point in time provided by backup copies can hel...
Q: Who made the first flash drive?
A: The first flash drive
Q: When it comes to infrastructure and architecture, what is the difference?
A: Intro the difference infrastructure and architecture
Q: In computer memory, how do local declarations get put in place? Yes, but there aren't any good reaso...
A: Introduction Memory Allocation: The technique by which the software creates "space" for information...
Q: What is the hexadecimal D72 when converted to 16-bit binary? (Must be 16 bits)
A: To convert hexadecimal into binary, represent each digit into binary bits having group of 4bits.
Q: A special static method named_is used to provide a starting point for the execution of a program usi...
A: special static method method named is
Q: Based on Figure 1, use forward chaining approach to derive conclusion, if the working memory consist...
A: As you mentioned Based on Figure 1 - But the figure was missing in the question. Please provide the ...
Q: Ascertain what a CPU is.
A: A computer is an electronic machine that takes input, processes it and produces output. Input device...
Q: Computer Science Binary Search Tree Implement Binary search Tree (BST) and perform the following ope...
A: A binary search tree is a type of tree that contains the values in a specific order. Given keys are1...
Q: B. If Alice uses the same k to encrypt two messages M1 and M2 as (12, 65) and (12, 64), what is the ...
A: The answer is
Q: Write a program that prints out first 40 numbers divisible by 3.
A: As you have not mentioned the programing language we are providing the program in Python language.
Q: ite a program InOrder that reads in three different integers and prints the three integers in ascend...
A: In Python we use input function to get input from the user. We can use it like this a = input (" En...
Q: Internet investigation is being used. the deeds of Mafiaboy In what time period and via what means d...
A: Mafiaboy is nicknamed the "bratty-kid" who brought the internet down. Michael Calce (Mafiaboy) was b...
Q: It's a type of memory architecture that has two separate channels for each piece of memory.
A: Computer Networks: Operating systems and other systems in computer science work together to provide ...
Q: What are the major components of an information system, and what is a mission-critical system?
A:
Q: A light y should illuminate when neither room b is occupied nor room c is occupied. The functionalit...
A: In the given function y = (b + c)' The light y will get lit up in the above condition we have give...
Q: Computer Science Max Lin is a company which offers financial services to its customers. They have e...
A: what is booting? The process of starting a computer is known as booting. Hardware, such as a button ...
Q: Question 2: A student will not be allowed to sit in exam if his/her attendance is less than 75%. Tak...
A: Java program to find the percentage of attendance
Q: Write a Python program that takes two values as user input, x and y; then applies the following equ...
A: Given The answer is given below.
Step by step
Solved in 3 steps with 1 images
- Write a function called `filler(A, l)` that takes an integer `A`, and a list of integers `l` and if some of the numbers in `l` sum up to `A` then it returns a list of these numbers. Otherwise, it returns `None`. For example, filler(5, [1,6,3,4]) returns [1,4]. filler(5, [1,6,3,7]) returns None. filler(0, [-1,-1,2,-3]) returns [-1,-1,2]. filler(10, [2,3,2,3,1]) returns [2,3,2,3]. If there are multiple answers, then return any of them. You can use each number in the list once for each occurence. """ def filler(A, l): # remove the following line to solve this question returnWrite a function MedianWithoutHL(ScoreList) that takes an unsorted list of n numbers as a parameter, discards the highest and the lowest numbers and return the median. You can assume the number of items in the list is between 0.0 and 9.9. To find the median from a list of items, you have tosort the list and find out the value of the item in the middle.Note: If the list has an odd number of items, the median is the value of the middle item. If the list has an even number of items, the median is the average of the two middle items.Sample Run #1:scoreList1 = [9.0, 9.0, 7.5, 8.0, 9.5, 6.5, 5.0, 7.0, 7.5, 8.5]print("The Original ScoreList: ", scoreList1)print(MedianWithoutHL(scoreList1))Output of Sample Run #1:The Original ScoreList: [9.0, 9.0, 7.5, 8.0, 9.5, 6.5, 5.0, 7.0, 7.5, 8.5]The List after sorting: [5.0, 6.5, 7.0, 7.5, 7.5, 8.0, 8.5, 9.0, 9.0, 9.5]Without the High & Low: [6.5, 7.0, 7.5, 7.5, 8.0, 8.5, 9.0, 9.0]7.75Write a function that takes two arguments, a list L1 and a list L2. • If the length of the list L1 is greater than twice the length of the list L2, then append the first three values of L1 to the three last values of L2. E.g. if L1 = ‘(1 2 3 4 5 6 7) and L2 = ‘(8 9 10), then return ‘(1 2 3 8 9 10) Should be written in the Racket programming language
- The function list_combination takes two lists as arguments, list_one and list_two. Return from the function the combination of both lists - that is, a single list such that it alternately takes elements from both lists starting from list_one. You can assume that both list_one and list_two will be of equal lengths. As an example if list_one = [1,3,5] and if list_two = [2,4,6]. The function must return [1,2,3,4,5,6].rite a function numPairs that accepts two arguments, a target number and a list of numbers. The function then returns the count of pairs of numbers from the list that sum to the target number. In the first example the answer is 2 because the pairs (0,3) and (1,2) both sum to 3. The pair can be two of the same number, e.g. (2,2) but only if the two 2’s are separate twos in the list.In the last example below, there are three 2’s, so there are three different pairs (2,2) so there are 5 pairs total that sum to 4. Sample usage: >> numPairs( 3, [0,1,2,3] )2Write a function that will accept a list of numbers and an integer (n). Thefunction should return a list containing every nth item from the input list,always starting with the first item in the list. The original list should notbe modified.For example, if the function is passed the list[8, 3, 19, 26, 32, 12, 3, 7, 21, 16]and the integer 3, it will return the list[8, 26, 3, 16]The function should be general, and work for any list and any positiveinteger value of n.def countByN(myList,n):return myList[::n]
- The following C function takes a single-linked list of integers as a parameter and rearranges the elements of the list. The function is called with the list containing the integers 1, 2, 3, 4, 5, 6, 7 in the given order. What will be the contents of the list after the function completes execution? struct node { int value; struct node *next; }; void rearrange(struct node *list) { struct node *p, * q; int temp; if ((!list) || !list->next) return; p = list; q = list->next; while(q) { temp = p->value; p->value = q->value; q->value = temp; p = q->next; q = p?p->next:0; } } a) 1, 2, 3, 4, 5, 6, 7b) 2, 1, 4, 3, 6, 5, 7c) 1, 3, 2, 5, 4, 7, 6d) 2, 3, 4, 5, 6, 7, 1this code should be in python: write a function that receives a list as its only parameter. Inside the function remove all the duplicate items from the list and returns a new list. For Example: If we call the function with [“dad”, “aunt”, “mom”, “sister”, “mom”] as its input, the returned value should be [“dad”, “aunt”, “mom”, “sister”]. The order of the items inside the returned list does not matter.Write a function named how_many(a_list, a_num) that that expects a list of numbersand a number as arguments. It returns how many times the number is found in the list.If the number is not in the list, return 0. For examplehow_many( [12, 15, 16, 4, 10, 3, 5, 7, 9, 15], 15 )returns 2 And how_many( [12, 15, 16, 4, 10, 3, 5, 7, 9, 15], 11 )returns 0Ask the user for an integer between 0 and 19. If the number is in the list, report howmany times it occurs.
- Please answer it in Python Write a function min_pair that takes a list as an argument and returns the smallest even integer contained in the list. If the list contains no even integers, the function will return None. Example: min_pairs([4, 7, 12, 0, 21, 5]) is 0 min_pairs([9, 3, 1]) is None. min_pair([16, 13, 10, 102, 7, 23]) is 10Write a function called myunion that will take two lists x and y, and return a list that has the elements of x, followed by the elements of y that are not found in x. For example: (myunion ’(1 3 5 7 9) ’(1 2 3 4 5 6 7)) should return (1 3 5 7 9 2 4 6).Please answer it in Python Write a function insere_milieu that takes as an argument a list l and an element elem and returns the list obtained from l by adding elem "in the middle" of l, that is: If the length of l is even, the item is added once, in the middle of the list. If the length of l is odd: the element is added on either side of the central element. Example: insere_milieu([4, 7, 12, 3], 0) is [4, 7, 0, 12,3] insere_milieu([9, 3, 5, 6, 2], 1) is [9, 3, 1, 5, 1, 6, 2].