Write a decale function that takes as an argument a list l and a number d and returns the list obtained from l by adding an offset of d to each element of l. Example: decale([4, 17, 12], 3) is [7, 20, 15]. Write a function intercale_zeros that takes as an argument a list l and returns the list obtained from l by inserting a zero after each element of l. Example: intercale_zeros([4, 17, 12]) is [4, 0, 17, 0, 12, 0].
Q: SOQL Assignment Salesforce: You have to write a SOQL query in which we have to find out all the 1000…
A: Use the Salesforce Object Query Language (SOQL) to search your organization’s Salesforce data for…
Q: 1. Why data fields should be private?
A: Let's know what is private and then you will be in a better position to understand why data fields…
Q: This code is for c++ Write the Program for both the .h and the .cpp for the UML diagram Account…
A: Account.h code: #ifndef AccountH #define AccountH #include <iostream> using namespace std;…
Q: Describe how you would communicate to Ashok and the rest of the team about Ashok's injury. What…
A: In this case, since the first thing to do is to communicate the injury to the team members while…
Q: How would you describe three forms of hardware that are required to support a company's operations,…
A: Business Hardware Selection Choosing the Proprietary Business HardwareIf a firm wants to improve its…
Q: reony sutabe greh toversal sechrique which usas queue as e supporting component to cany out the…
A:
Q: What is the meaning of Datatype in Python? Please provide at least two examples
A: Introduction Datatype Data type is used to represent particular data. Data types are classes whereas…
Q: 2. Which of the following will allow you to remove your table in the database? (SQL) A. DELETE FROM…
A: - we need to choose correct for the SQL statements.
Q: Consider the following program written in AC language discussed in the class. The tokens and grammar…
A: the solution is an given below :
Q: Q2) Consider the regular expression: (ablac)* a. Use Thompson's construction to construct a NFA
A: Given Regular Expression : (ab|ac)*
Q: Declaring a class virtual transforms it into an abstract class. T/F
A: Introduction: When it comes to object-oriented programming, a virtual class is a form of class where…
Q: 2. Show the steps to ping the IP address of another computer
A: Ping on a computer: Ping is a computer system architecture powerful application that checks whether…
Q: uct page for a furniture st
A: I have designed the question below:
Q: What exactly is middleware?
A: Introduction: It is a piece of software that allows for the use of one or more types of…
Q: Describe how a stateless firewall would prevent all incoming and outgoing HTTP requests.
A: Introduction: You must allow both incoming and outgoing traffic on the following ports:
Q: 1. List some of application that you can controlled by a potentiometer. 2. Explain the function of…
A: Since you have asked multiple questions, we will solve the first question for you. If you want any…
Q: Explain the significance of continuous event simulation in detail
A: Introduction Explain the significance of continuous event simulation in detail.
Q: Deeply and briefly explain about intel AI for youth?
A: Artificial intelligence can be defined in a variety of ways, owing to the difficulty of defining…
Q: Complete a program in a class ToyCounter that computes the cost of toys sold in a shop. Five kinds…
A: Program for create toyCounter and compute the total cost
Q: . Your Content (50% mark) 2. Your Formatting (50%). Your work has to be in proper APA format, must…
A: Each question is answered in different steps 1.a Active directory Rights Management Services.…
Q: Sam and Sangu played a game. First, the Sam gives Sangu a sequence of different numbers N a1, a2,.,…
A: Input/Output Explanation: The first line of the input contains a single integer T denoting the…
Q: Six LINQ operators are available for usage in a query.
A: Definition of LINQ LINQ is for Language Integrated Query, and it's a feature of Microsoft's.NET…
Q: Use your own words to describe four different ways used to develop a project WBS briefly. Then,…
A: ANSWER:-
Q: List the item ID, description, and category for each pair of items that are in the same category.…
A: ANSWER:-
Q: what is the mechanism through which an operating system maintains memory, processes, and threads?
A: Memory management : The operating system (OS) manages a computer's principal or primary memory.…
Q: How are the untrusted network, the firewall, and the trustworthy network normally connected?
A: Introduction: While the Internet or another portion of a public access network is frequently used as…
Q: What is the value of JFK for the conversion below to be correct? (0100111JFK00)2 = (4FC)16 %3D…
A:
Q: Describe the functioning of the hard disk drive in a few words (HDD). What are the SSD's operating…
A: Introduction: The hard disc drive's operation (HDD) Platters: A platter is a huge circular magnetic…
Q: Computer science What are your thoughts on the TCSEC orange book?
A: Introduction: PC security is essentially the protection of a computer's structure and data from…
Q: Write a program to sort (using bubble sort) a set of 30 numbers stored in a file.
A: NOTE : As the question is not specific about the programming language to be used, so Python will be…
Q: What is meant by a pointer variable in c++? How is it used?
A: Answer the above questions are as follows:
Q: variable name in the programming language Visual Basic must begin with a letter (uppercase or…
A:
Q: What impact has the Internet had on system architecture?
A: Introduction: The Internet (or simply the Internet) is a global computer networking infrastructure…
Q: When you invoke a method on an object instance, the version of the method that will be executed will…
A: Instance methods are methods that require the creation of a class object before they may be invoked.…
Q: The question is, how do you keep class fields safe from unintentional modification?
A: Answer :
Q: What is the name given to the data that has been transferred from RAM to virtual?
A: We are going to understand the terminology which is responsible for transferring data from RAM to…
Q: Group root = new Group (); Scene scene = new Scene (root, 400, 400, Color.WH horizontalLines (10,…
A: I have the complete code below:
Q: Because a data warehouse is too large for business intelligence, a data mart is preferable to a data…
A: Justification: A data warehouse is a sort of data management system that is intended to facilitate…
Q: Please solve the question for beginners in programming 1. Write a method that receives the…
A: Java code for area of circle using method.
Q: We'll say that a String is ab-balanced if for all the 'a' chars in the string, there exists a 'b'…
A: Java program for above : import java.util.Scanner; class Prog{ public static void main…
Q: Explain the two-tier architecture of databaSeS.
A: Introduction: In a two-tier design, there are just two modules to be concerned with.
Q: Create an ordered, rooted tree that represents the infix form of the following equation. Then write…
A:
Q: LAN1 Usable #of Hosts: 100 Users Network Address: ?
A: I have answered below in the description.
Q: Discuss why it is critical for Systems Analysts to model the subject-domain of an information system…
A: Introduction: The systems analyst is in charge of defining the transforms implied by both the source…
Q: The following sample fle called studentdata.txt contains one line for each student in an imaginary…
A: - We have to get the student with maximum number of quizzes. - We are using python here.
Q: Software engineering Short answer Why Speech recognition is difficult to implement in real-time…
A: Introduction: Speech recognition is the process of recognising any sound using software and then…
Q: What is the significance of software development? The software development process may benefit from…
A: Software development :It refers to a set of computer science activities dedicated to the process of…
Q: Identify 5 current security architecture and design risks. Then: a) Describe each danger.
A: Malware: In order to steal or exchange information from you, a cybercriminal might pose as a…
Q: Homework 8.1 Using java fx programming draw the below picture
A: You are required in the below steps. Follow the screenshot to avoid an indentation error. You should…
Q: using equation method for Hamming code of (7,4),determine of the Following messages m1 = 1111 &…
A: The Answer is
Please answer it in Python
Write a decale function that takes as an argument a list l and a number d and returns the list obtained from l by adding an offset of d to each element of l.
Example: decale([4, 17, 12], 3) is [7, 20, 15].
Write a function intercale_zeros that takes as an argument a list l and returns the list obtained from l by inserting a zero after each element of l.
Example: intercale_zeros([4, 17, 12]) is [4, 0, 17, 0, 12, 0].
Step by step
Solved in 3 steps with 2 images
- Code in python Given a list, L, the function front_two creates a new list of length 2 out of the first two items in L as follows: In the new list, the second item becomes the first item, and the first item becomes the second. If L contains only one item, the first item in the new list should be the value None. If L is empty, both items in the new list should be value None. The function returns the new list. For example: Test Result L = ['a', 'b', 'c', 'd'] print(front_two(L)) ['b', 'a'] L = [] print(front_two(L)) [None, None] L = [5, 2] print(front_two(L)) [2, 5] L = [7] print(front_two(L)) [None, 7]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].Please answer it in Python Write a function min_odd 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. For Example : min_odd([45, 62, 19, 22, 26, 18, 3, 5, 14])Expected answer is 14 min_odd([])Expected answer is None Write a function index_of that takes as an argument an integer (supposedly even) and a list, and returns the index to which this integer appears in the list. If the integer does not appear, the function will return None. It is assumed here for simplicity that the integer searched for does not appear several times in the list. Hint: if the for e in list loop doesn't suit you, remember that you can make a for + range or a while. .. For Example: index_of(34, [3, 67, 62, 34, 19, 24])Expected answer is 3 index_of(16, [2, 6, 104, 5, 25, 18, 50, 16])Expected answer is 7
- emacs/lisp function Write a function that takes one parameter that is a list of numbers and returns true (t) if all the elements of the list are multiples of the first one and nil otherwise. This said, a list generated by the function make-multiples could be passed to this new function and the result should be true. On the other hand, show an example of a list that could not have been generated by the first function for which the result is still true.Write a function count_evens(nums) that takes a list of ints called nums and returns the number of even ints in the given list. Note: the % "mod" operator computes the remainder, e.g. 5 % 2 is 1.Because floating-point numbers are imprecise, it is common to compute data values of type float that are very close but not exactly equal to the value 0.0. a) In Python, Write a function countNZdata that counts number of elements in a list of type float whose absolute value is less than or equal to a positive tolerance parameter. The function takes the list as its first parameter; the second parameter is the positive float value that is the tolerance. Function should return the number of data values that meet this criterion. For example, for the given list: [2.19, -0.04, 1.66, 0.05, 4.70, -6.53, -0.11, -1.07, 1.94, -2.23] and a tolerance = 0.1, the function should return the value 3. b) Demonstrate that the function works by inputting different example values.
- Q4. Write a program that read 2 matrices and has a function which finds their sum. Q5. Write a program that read 2 matrices and has a function which finds their multiplication. Q6. Write a program that handles a list of numbers where it has the following functions - Function that finds their average and sum - Function that finds their maximum and minimum - Function that search for a given number in that list. - Function that count the occurrence of a given number in that list. Then the program should do the following: - Read the list - Find the average and the sum of that list - Find the minimum and the maximum of that list - Count the occurrence of a given number in that list.Write a program in Python including the following functions: a) Write a function that takes a list and 2 integers x and y as parameter and performs the following: • If the list has an even number of elements, inserts y number of x's in the middle of the list. • Otherwise, inserts y number of x's to the end of the list • Returns the list. Sample Run: 1st=[2,3,4,5] 1st=fun(1st,9,2) [2, 3, 9, 9, 4, 5] b) Write a function which takes a list of integer digits and an integer as parameter (to store powers of 10) and returns an integer which is composed of the digits in the list. Sample Run: print (form(1st,1)) #for 1st=[2,3,9,9,4,5] 239945 c) Call the first function, and send the returning list to the second function. You do not need to input anything. Note: You can use list functions, but no loops and no type conversion. Recursion is allowed. OWrite a function is Prime (a_nNum) that takes a positive integer as an argument and returns True if the argument is a prime number, or False otherwise. A prime number is a number that is only evenly divisible by itself and 1. Then, write a function listOfPrimes (a_nSize) that takes a number as an argument and returns a list of the first a_nSize prime numbers. Use the previously defined is Prime (a_nNum). Finally, test your function listof Primes (a_nSize). Hint: Recall that the operator divides one number by another and returns the remainder of the division. Example: listOfPrimes (10) returns [2, 3, 5, 7, 11, 13, 17, 19, 23, 29).
- Write a function that accepts two lists as it's only arguments. The function should return a new list containing all the elements of the two list arguments. For example, if the function was passed the lists [1, 2, 3] and [4, 5, 6], it would return a new list containing [1, 2, 3, 4, 5, 6]python codeWrite a Python function listDictPrime() that gets as parameter a list of integers, creates and returns a dictionary where keys are the integers of the list and values are either "prime" or "not prime" depending on key being prime number. Assume that there is a function isprime() that gets an integer parameter and returns True if the integer is a prime number, and returns False if not. Use function call to this function. Do not write this function. Example: if parameter list is [4, 7, 2, 6, 3], then the returned dictionary will be {4: "not prime", 7: "prime", 2: "prime", 6: "not prime", 3: "prime"}. Write only the function listDictPrime().Write a function verifsort that accepts a list as a parameter, check if the list elements are sorted and returns: 1 - if the list is sorted in ascending order, 2 – if the list is sorted in descending order, and 0 – if the list is not sorted. Write a function listsort which accepts a list as a parameter, and sorts it in ascending order. You can use any standard sorting algorithm, but don’t use built-in sort methods and functions. The function must sort and return the list. Write a script that asks user to enter 10 integer numbers, creates a list from those numbers, then calls verifsort function to detect if this list is sorted, prints message (list is sorted or list is not sorted) and if it’s not sorted then calls listsort function and prints the sorted list after listsort