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 a problem-solving technique where each problem in a database is stored with a description and keywords that identify it
babymother [125]

Answer:

Case-based reasoning.

Explanation:

A database management system (DBMS) can be defined as a collection of software applications that typically enables computer users to create, store, modify, retrieve and manage data or informations in a database. Generally, it allows computer users to efficiently retrieve and manage their data with an appropriate level of security.

A data dictionary can be defined as a centralized collection of information on a specific data such as attributes, names, fields and definitions that are being used in a computer database system.

In a data dictionary, data elements are combined into records, which are meaningful combinations of data elements that are included in data flows or retained in data stores.

This ultimately implies that, a data dictionary found in a computer database system typically contains the records about all the data elements (objects) such as data relationships with other elements, ownership, type, size, primary keys etc. This records are stored and communicated to other data when required or needed.

Basically, when a database management system (DBMS) receives data update requests from application programs, it simply instructs the operating system installed on a server to provide the requested data or informations.

Case-based reasoning is a problem-solving technique where each problem in a database is stored with a description and keywords that identify it. It is typically based on cognitive science and artificial intelligence.

7 0
2 years ago
Who wrote the book of luke​
netineya [11]
Luke himself wrote t the book
5 0
2 years ago
Jabez needs to alert through an SMS text message those corporate users who have a specific brand and type of mobile device regar
Maslowich

Answer:

Push notification services.

Explanation:

Push notification services can be used to deliver important messages on mobile devices in an efficient and timely manner. The different mobile platforms such as android, iOS have their services which makes it easy for Jabez to send the messages to users with a specific brand and type of mobile device. The messages will pop up on the mobile device of the user, whether the app or the website associated with notifications is running or not.

7 0
3 years ago
Which best describes a computer bug?
yanalaym [24]

Answer:

a piece of computer software containing defects that prevent a program from running properly

Explanation:

i got a 100% on the test

6 0
3 years ago
Are computer software programs an example of land, labor or capital?
Allisa [31]

Answer:

Labor

Explanation:

3 0
2 years ago
Read 2 more answers
Other questions:
  • Lydia used software and numerical data to create bar graphs. What software did she use?
    8·2 answers
  • Which amendment discussed in the unit do you think has the greatest effect on your life? Why?
    14·1 answer
  • Smart art can be used to create _____that highlights relationships betweeen two items
    8·2 answers
  • Question 3 of 10
    13·1 answer
  • What does it mean to be self demanding?
    12·1 answer
  • What is the main feature of chat rooms?
    9·2 answers
  • .true or false? one disadvantage of cloudware is that it is never free<br> A. true<br> B. false
    12·1 answer
  • What game is this?????????????????????
    15·1 answer
  • Design a program that asks the User to enter a series of 5 numbers. The program should store the numbers in a list then display
    14·1 answer
  • For some reason my code is not printing in python. It doesn't give me an error is just not printing no thing shows up
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!