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
Sonbull [250]
3 years ago
7

Write a function (funception) that takes in another function func_a and a number start and returns a function (func_b) that will

have one parameter to take in the stop value. func_b should take the following into consideration the following in order: Takes in the stop value. If the value of start is less than 0, it should exit the function. If the value of start is greater than stop, apply func_a on start and return the result. If not, apply func_a on all the numbers from start (inclusive) up to stop (exclusive) and return the product.
Computers and Technology
1 answer:
castortr0y [4]3 years ago
3 0

Answer:

The code for this question can be defined as follows:

def funception(func_a, start):#define a method funception that accept two parameter

   def func_b(stop): #define a method func_b that accept one parameter

       if start < 0:#define if block that checks start parameter value less then 0

           return #Use return keyword

       if start > stop:#define if block that checks start parameter value greater then stop parameter value

           return func_a(start)#use return keyword to call func_a method

       else:#define else block

           product = 1#define a variable product and assign a value 1

           for i in range(start, stop):#define for loop to calculate the value

               product= product * func_a(i)#multiply the method value in product variable

           return product#return prod value

   return func_b#return func_b value

def func_a(num):#define a method func_a that accept a num variable as a parameter

   return num + 1#use return keyword by increment num value by 1

Explanation:

In the above python program code, a method "funception" is defined that accepts two parameters that are "func_a and start", in which "func_a" is a method name, that accepts a "num" variable in its parameter and returns its one increment value.

  • Inside the method, another method that is "func_b" is defined that accepts a "start" variable in its parameter and uses it if block to check "start and stop" values.
  • If the start value is less then 0 it will exit the program. If the start value is less then stop value so, it will return the "func_a" value.
  • In the else part, a "product" variable is defined that multiplies the method "func_a" value and returns its value.
You might be interested in
Edhesive Assignment 11
Marrrta [24]
This worked for me when I took the course
5 0
3 years ago
Can somebody hack ur account on Brainly bc I feel like I have bc I have answered waaaaaay more questions than shows on my profil
QveST [7]
It says you’ve only answered 11, but yeah it you’re account CAN be hacked
4 0
3 years ago
Which feature enables you to format data using specific conditions?
Nina [5.8K]
Cell protection
open Review tab>> Changes Group>>Protect Sheet
3 0
3 years ago
Read 2 more answers
In web developing, what are the differences between front-end developer, back-end developer and full stuck developer?
Ilia_Sergeevich [38]

When it comes to front end, back end and full stack developer, the difference is determined by :

front end (the visible parts of a website)

back end (the “under the hood” databases and infrastructure)

full stack (a hybrid of both)

And front end developers work on technologies that are used to build front end(which is what clients visiting that website see)of application like HTML,CSS, Javascript ( Node js, Angular are also now used ).

Similarly back end developers work on back end technologies like Node js.

Full stack developers work on both front end and back end developers and know  both end technologies as well.

For example :

MEAN Stack developer where

M stands for Mongoose ( Back end database technology )

E stands for Express ( Back end technology)

A stands for angular ( front end technology)

N stands for Node ( back end technology)

8 0
3 years ago
What is the difference between gross salary/wage and net salary/wage?
Rudiy27

Gross pay is the amount you owe employees before withholding taxes and other deductions. Gross pay is not the amount you pay your employee. You must use gross wages to calculate your employees' net wages. Net pay is what an employee takes home after deductions.

6 0
3 years ago
Other questions:
  • Which of the following best describes a computer virus? another name for a software bug the product of a computer crash software
    10·2 answers
  • What can be designed to create annoying glitches or destoey data?...
    13·2 answers
  • "when a dynamic web page is requested, the web server passes the request to"
    15·1 answer
  • How far from the bullet is text indented
    6·2 answers
  • Which of the following is NOT a unit used to measure temperature?
    13·1 answer
  • What are the ASE special certifications?
    14·2 answers
  • Insufficient vacuum will require the driver to _______________ to adequately activate the brakes?
    13·1 answer
  • Please help!! I dont need the answer i just need explaining on how to do this!!!!
    9·1 answer
  • Kolom terakhir pada lembar kerja Excel 2019 adalah​
    14·1 answer
  • Why is it so important to have a checking account?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!