1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
SVETLANKA909090 [29]
3 years ago
8

Write a function similar to keep_ints like before, but now it takes in a number n and returns a function that has one parameter

cond. The returned function prints out numbers from 1 to n where calling cond on that number returns True.
Computers and Technology
1 answer:
lukranit [14]3 years ago
5 0

Answer:

def make_keeper(n):

   """Returns a function which takes one parameter cond and prints

   out all integers 1..i..n where calling cond(i) returns True.

   >>> def is_even(x):

       # Even numbers have remainder 0 when divided by 2.

       return x % 2 == 0

   >>> make_keeper(5)(is_even)

   2

   4

   """

   def fun(cond):

       for i in range(1,n):

           if(cond(i)):

               print(i)

   return fun

Explanation:

  • Define a function called fun that takes cond as input.
  • loop from 1 to n and display the value if it meets the requirement.
You might be interested in
1.an electronic index of books A. web page
zimovet [89]
It was quite difficult to understand what you need. Anyway, I've got it. I guess you need to much all the terms to each sentence. So I think I've done it right. Check it out:

1.an electronic index of books - <span>B. computer catalog
</span><span>
2.a device which categorizes and locates web sites - </span><span>H. search engine
</span><span>
3.to draw a conclusion - </span>D. infer<span> 

4.a block of information stored in an HTML file on a server - </span><span>A. web page
</span><span>
5.the table of contents of a web site - </span><span>G. home page
</span><span>
6.a software package which retrieves information from any or all available Internet servers - </span><span>I. browser
</span><span>
7.a highlighted word or phrase within a web page which acts as a "bridge" to another web page or site - </span><span>F. hyperlink
</span><span>
8.a topic sentence - </span><span>C. key sentence
</span><span>
9.a term which aids in narrowing a web search - </span>E. keyword
5 0
3 years ago
What does an operating system do
3241004551 [841]

Answer: An operating system manages and runs all of the hardware and software installed onto the computer.

Explanation:

It performs basic tasks such as file, memory, and process management, handling input and output, and controlling peripheral devices such as disk drives and printers.

7 0
1 year ago
Arrange the steps for conflict resolution in proper sequence.
VashaNatasha [74]

1.Clarify what the disagreement is

2. Establish a common goal for both parties

3. Discuss ways to meet the common goal 

4. Determine the barriers to the common goal

5. Agree on the best way to resolve the conflict

6. Acknowledge the agreed upon solution and determine the responsibilities each part has in the resolution 

8 0
3 years ago
Read 2 more answers
The display in D1 should read Colin McCain what text function should be used
Kaylis [27]

Answer:

The answer is "SUBSTITUTE(D1,"c","C",1)"

Explanation:

In the given question, some information is missing, that is an option so, the correct option can be described as follows:  

  • Many of us use the Bulletin feature, which is available in MS-Excel.  In these function the SUBSTITUTE is a method, that is used in Builtin to aim the functions to locate a string or character and to replace with the selected module.  
  • In the case of the end-user, it would like to replace "c" with a capital letter "C." And displays cell shifts in D1. This method uses 4 parameters, in which first describes cell reference, second string to located, third replacing string, and fourth its length.
8 0
3 years ago
In a real pulley system, the work supplied must be the work accomplished.
vazorg [7]

sorry I was testing something

8 0
3 years ago
Other questions:
  • Ben uses a table that has few columns. He knows about a particular value in the first column and wants to find the corresponding
    8·2 answers
  • In this scenario, two friends are eating dinner at a restaurant. The bill comes in the amount of 47.28 dollars. The friends deci
    7·2 answers
  • What is wearable technology? Provide at least one example
    13·2 answers
  • How is technology closely linked to creativity
    15·1 answer
  • A mobile device has stopped receiving automatic OS updates that until recently were pushed to the device.
    7·2 answers
  • Which of the following is a popular open source intrusion detection system that runs on SmoothWall?? Synchronous Dynamic Random
    6·1 answer
  • Which activity does not allow a person to perform any work while at the shop
    10·1 answer
  • URGENT!!!
    9·1 answer
  • Mary is a big fan of tropical fish. She has a few tanks of fish at home. To maintain a healthy environment for the fish, she nee
    9·1 answer
  • The computer that can be used for performing the daily life tasks that might include emailing, browsing, media sharing, entertai
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!