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
Is there an air flow through the house? if so, does the air flow in the window and out the chimney, or in the chimney and out th
soldier1979 [14.2K]

The correct explanation is option B. The pressure is reduced at the chimney due to the movement of the wind above. Thus, the air will flow in the window and out the chimney.

<h3>What is the main purpose of chimney?</h3>

The primary work of the chimney is to show the way that the smoke need to take away from the stove and also out of the house.

Hence, The correct explanation is option B. The pressure is reduced at the chimney due to the movement of the wind above. Thus, the air will flow in the window and out the chimney.

Learn more about chimney from

brainly.com/question/24792291

#SPJ1

See full question below

Is there an air flow through the house? If so, does the air flow in the window and out the chimney, or in the chimney and out the window? Choose the correct explanations.

A. The pressure is increased at the chimney due to the movement of the wind above. Thus, the air will flow in the chimney and out the window.

B. The pressure is reduced at the chimney due to the movement of the wind above. Thus, the air will flow in the window and out the chimney.

C. The pressure is increased at the chimney due to the movement of the wind above. Thus, the air will flow in the window and out the chimney.

D. The pressure is reduced at the chimney due to the movement of the wind above. Thus, the air will flow in the chimney and out the window.

E. The pressures at the chimney and the window are the same. Thus, the air will not flow.

5 0
1 year ago
Which code snippet is the correct way to rewrite this in Semantic HTML?
xxMikexx [17]

Answer:

<div id="header">

<h1>Waketech</h1>

</div>

<header><h1>Waketech</h1></header>

Explanation:

I think thats the answer your welcome

8 0
1 year ago
Which of the following is not a benefit of shaping data with the Power Query Editor?
algol13

Answer:

A

Explanation:

I am not 100% sure but without the shaping data, data can still be merged from multiple sources.

3 0
2 years ago
Ask how many apples the user wants. Ask how many people the user will share the apples with. Find out how many apples will remai
Sati [7]

Answer:

The program in Python is as follows:

apples = int(input("Apples: "))

people = int(input("People: "))

apples%=people

print("Remaining: ",apples)

Explanation:

This gets the number of apples

apples = int(input("Apples: "))

This gets the number of people to share the apple

people = int(input("People: "))

This calculates the remaining apple after sharing the apple evenly

apples%=people

This prints the calculated remainder

print("Remaining: ",apples)

5 0
3 years ago
ISO 400 is twice as sensitive and ISO 100 true or false
beks73 [17]

Answer:

Quite simply, when you double your ISO speed, you are doubling the brightness of the photo. So, a photo at ISO 400 will be twice brighter than ISO 200, which will be twice brighter than ISO 100.

Explanation:

ISO most often starts at the value of ISO 100. This is the lowest, darkest setting, also called the base ISO. The next full stop, ISO 200, is twice as bright, and ISO 400 is twice as bright than that. Thus, there are two stops between ISO 100 and 400, four stops between 100 and 1600, and so on.

4 0
3 years ago
Other questions:
  • Explain the function of the Ribbon in Microsoft Word.
    15·1 answer
  • What is secondary exchange ? - Apex
    14·1 answer
  • Where can I watch infinity war for free?
    9·1 answer
  • Anna’s computer will not power on. What aspect of the computer should Anna check (hardware or software)? How can Anna work to re
    5·1 answer
  • Why does brainly keep saying “oops... something went wrong! Try again”
    7·2 answers
  • A server of service is responsible for sending the contents of cengage.com to your browser when you type cengage.com into the lo
    12·1 answer
  • Write a program that converts or calculates values. Use the following guidelines to write your program:
    9·1 answer
  • How many types of window in Qbasic​
    7·1 answer
  • 3.5 code practice question 1
    5·2 answers
  • At what layer in the TCP/IP protocol hierarchy could a firewall be placed to filter incoming traffic by means of:
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!