Please answer it in Python Write a function extrait_pairs that takes as an argument a list l1 and returns the list obtained from l1 keeping only the even integers (and without changing their order). Be careful, l1 must not be modified by the function. Example: extrait_pairs([4, 7, 12, 0, 3]) is [4, 12, 0] and extrait_pairs([21, 17, 3]) is [ ].
Q: We'll say that a String is ab-balanced if for all the 'a' chars in the string, there exists a 'b'…
A: import java.util.*;public class Main{ public static void main(String[] args) { Scanner sc=new…
Q: Suppose we have four truth values 0, 1/3 , 2/3 , 1, and we define the Lukasiewicz conditional . Give…
A: Infinite-valued Łukasiewicz logic is real-valued logic, where the sentences in the product of…
Q: Q1) on the simulator simulate the NFA that recognizes the language Af. The language 1 (001*)* with…
A: We have to draw a NFA with only 3 states for given language : 1* (001+)* I have provided the NFA on…
Q: Practice by making a Ship class with the following members: A field for the name of the…
A: The above code is solved in Java below:
Q: Project: Create a program that calculates the interest on a loan. This program should make it easy…
A: Step 1 : Start Step 2 : Define the function interest() which would calculate the interest with the…
Q: What is an instantaneous description (ID) of a pushdown automaton (PDA)?
A: Answer the above question are as follows
Q: Can you explain the difference between strong AI and weak AI?
A: Introduction: Strong AI is a hypothetical sort of machine knowledge that argues that machines can…
Q: Implement a 2-4 decoder in Verilog HDL using case statements. Simulate the code with a test.…
A: Implement a 2-4 decoder in Verilog HDL using case statements. Simulate the code with a test. (…
Q: CSV text files are what they sound like. What is a straightforward command that can be used to break…
A: Text files with the extension CSV (Comma-separated values): Text files with the extension CSV…
Q: Agile, object-oriented, and ad hoc methods of development are all distinct from each other. Which…
A: Answer :
Q: What kind of memory is being used for the primary storage?
A: Computer Disk Space: A computer storage device is a component of a computer that allows data to be…
Q: Recast the following computational problems as decision problems. a. Sorting
A: a. Sorting Sorting is the process of ordering or arranging a given collection of elements in some…
Q: In Java, code a program that rolls a dice 100,000 times and prints out the result of how many 3, 4,…
A: INTRODUCTION: Here we need to write a code in java that rolls a dice 100,000 times and prints out…
Q: Explain program counter in instruction cycle with examples (Computer Architecture
A: central processing unit is also called a main processor or just processor is the electronic…
Q: Public cloud implementation diagram
A: The diagram is given in the below step
Q: What modifications may be made to a computer network system in order to prevent it from being…
A: answer is
Q: Computer science What types of information system 'Hardware' breaches are most common? Text on a…
A: Introduction: Through different system hardware tools, a hardware security threat can generate an…
Q: Software engineer Short answer :What should we do to achieve Usability?
A: Introduction: What should we do to achieve Usability? The capacity of any program that a user uses…
Q: Write a c# program to find the weekday from current moment after 90 days
A: In C#.
Q: One advantage of compiling to bytecode rather than machine code is that it saves time.
A: Byte code is the intermediate code between the source code and machine code. The byte code is…
Q: Compare and contrast the utilization of thin clients with desktop PCs in a university computer lab.
A: Clients: A thin client is a small computer that connects to a server-based computing system through…
Q: computer science- What are the dangers of resume screening programmes? How does resume screening as…
A: Introduction: The following are the risks linked with resume screening programmes:
Q: What does it mean to build software using the prototype method?
A:
Q: In computer science, errors are most likely to occur during the programming phase, possibly as a…
A: Introduction: In computer science, errors can occur largely during the programming phase, and then…
Q: C. Using Structures and Files: Create a C++ program for Student record system. Note that: program…
A: //C++ program for student…
Q: 3. Job Scheduling: Consider the problem of scheduling n jobs of known durations ti, t2, ..., tn, for…
A: The answer as given below:
Q: Q2/Explain what is the machine learning in decision support system? Write information about it.
A: Most organizations today experience no difficulty gathering information, however knowing how to…
Q: What does privacy mean in the context of information security? Information technology
A: Introduction: The term "security" refers to the protection of data, whereas "privacy" refers to the…
Q: Why are acknowledgments present in 802.11 but not in wired Ethernet?
A: Let us see the details below.
Q: What exactly is an application programming interface (API)?
A: Introduction: The API (Application Programming Interface) is a type of programming interface (API)
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: Write the Python code to perform the following tasks: • Take as input from the user a string of…
A: Here we write the python code for the given information . and we attach the output , so the code of…
Q: Assume that you are applying “testing” and “inspection”, the two defect finding methods in the…
A: The answer is as follows.
Q: Explain any FIVE (5) benefits of IoT to businesses, society, and government. (Example: enhanced…
A: IOT Definition ---------------IoT stands for the Internet of Things. However, that doesn't explain…
Q: Computer science Why do businesses use cold e-mails? Short answer
A: Introduction: Businesses use advertising to broaden their market reach. This is achieved by…
Q: List two disadvantages of a computer device that use physical isolation.List two disadvantages of a…
A: Introduction: two disadvantages of a computer device that use physical isolation are :
Q: Share your experiences with planning a VLAN infrastructure.
A: Virtual LANs, or VLANs, isolated and focus on traffic on network joins. They make confined subnets…
Q: Create table "STUDENT" with attributes "STUDENT_ID", "STUDENT_NAME", "STUDENT GPA". Use appropriate…
A: NOTE : There is a policy from bartleby to solve only first 3 subparts of a question.
Q: Expain execute in instruction cycle with examples.
A: Role of Execution in instruction cycle.
Q: What distinguishes the Oracle database from relational databases?
A: Oracle databases are collections of data that are handled as a single entity. A database is used to…
Q: Is it possible to identify the four most common software issues?
A: The process of scanning, finding, diagnosing, and fixing faults, errors, and bugs in software are…
Q: Use your own words to describe four different ways used to develop a project WBS briefly. Then,…
A: ANSWER:-
Q: What is the difference between a variable and a constant?
A: Programming language : A constant in programming languages is a value that cannot be updated or…
Q: Discuss, with necessary diagrams and mathematical analysis, the electrostatic deflection as occur in…
A:
Q: Hexadecimal has a function, but what is it? What does the hexadecimal system mean?
A: Answer :
Q: 2. A particular drug therapy is known to have a 70% cure rate. For a drug trial consisting of 40…
A: Solution:-
Q: Provide me with the MATLAB code to swap the first and last row of the matrix given below, mat = 1111…
A: Provide me with the MATLAB code to swap the first and last row of the matrix given below, mat = 1 1…
Q: The alphabet set of a discrete memoryless source (DMS) consists of six symbols A, B, C, D, E, and F…
A: Huffman coding:It is a lossless data compression algorithm.To design a tree start by taking a…
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: What methods can be used to impsove information poivacy
A: The ways to keep your information private: Algorithms for cryptography: Homomorphic encryption is a…
Please answer it in Python
Write a function extrait_pairs that takes as an argument a list l1 and returns the list obtained from l1 keeping only the even integers (and without changing their order). Be careful, l1 must not be modified by the function.
Example: extrait_pairs([4, 7, 12, 0, 3]) is [4, 12, 0] and extrait_pairs([21, 17, 3]) is [ ].
Step by step
Solved in 3 steps with 1 images
- 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.In Python: Write a recursive function named Multiply2 that multiples by 2 and prints each element in a given list. For example: mylist=[1,2,3,4] Multiply2(mylist) prints: 2 4 6 8 Note: the function takes only one parameter, which is the list on which the operation will be performed. It's ok if the list becomes empty after calling the function.Listdiff Use the built-in higher order functions2 and write a non-recursive function val listdiff : ’a list -> ’a list -> ’a list = that, given 2 lists, returns a third, containing elements of the first list that are not in the second list. # listdiff [1;2;2;6;3;9;1;4;6] [2;3]; Using OCaml
- 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]two_sum is a Python function that takes in a list of integers (elements) and an integer number (num) and returns True if there exist two values in elements that add up to num, otherwise, function returns False. def two_sum(elements: List[int], num: int): for i in range(len(elements)): for j in range(i + 1): if elements[i] + elements[j] == num: return True return False Study above function and answer below questions: A. What is time complexity of two_sum? B. Is it possible to improve on above algorithm performance (in terms of its asymptotic cost)? If yes, describe your algorithm, be detailed as much as possible.In OCaml Programming Language: Use the built-in higher order functions and write a non-recursive function val listdiff : ’a list -> ’a list -> ’a list = <fun> that, given 2 lists, returns a third, containing elements of the first list that are not in the second list. # listdiff [1;2;2;6;3;9;1;4;6] [2;3];; - : int list = [1; 6; 9; 1; 4; 6]
- 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 recursive function named Multiply2 that multiples by 2 and prints each element in a given list. For example: mylist=[1,2,3,4] Multiply2(mylist) prints: 2 4 6 8 Note: the function takes only one parameter, which is the list on which the operation will be performed.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
- Write a function called CommonElements that takes in two ADT Lists and returns a new ADT List with the common elements of the two lists. Example:A = [3, 1, 10, 5] B = [5, 2, 6, 1] C = CommonElements(A, B) Print(C.ToString()) Should print: [1, 5] The lists can be of different size, even empty!Write a function multiply_ends (nums) that takes a non-empty list of integers and returns the first integer multiplied by the last integer. For example, if nums is the list [5, 4, 6, 2], the function would return 5 * 2 = 10. If the list has only 1 element, the first and last elements are the same so the function should return the square of the element. For example: Test Result print(multiply_ends( [5, 4, 6, 2])) 10 Answer: (penalty regime: 0, 10, 20, ... %) 1 | Precheck CheckIn OCaml Programming Language, write a function: val prime_separator : int list -> int list * int list = <fun> that takes an integer list as an input, and returns a pair of integer lists where the prime numbers are in the first while the composite numbers are in the second returned list. #prime_separator [1; 2; 3; 4; 5; 6; 7; 8; 9; 10; 11];; - : int list * int list = ([11; 7; 5; 3; 2], [10; 9; 8; 6; 4; 1])