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
Bad White [126]
3 years ago
9

Implement the sum_positive_numbers function, as a recursive function that returns the sum of all positive numbers between the nu

mber n received and 1. For example, when n is 3 it should return 1+2+3=6, and when n is 5 it should return 1+2+3+4+5=15.
Computers and Technology
1 answer:
lakkis [162]3 years ago
5 0

Answer:

def sum_positive_numbers(n):

if(n==0 or n==1): #if n is 0 or 1 return n as its sum also will be n

return n

return n+sum_positive_numbers(n-1) #else return n and sum of all the number smaller then n

print(sum_positive_numbers(3)) # Should be 6

print(sum_positive_numbers(5)) # Should be 15

Explanation:

You might be interested in
_ ports are audiovisual ports typically used to connect large monitors. These ports are used with many Apple Macintosh computers
cestrela7 [59]

Thunderbolt ports are audiovisual ports typically used to connect large monitors.

<h3>What is a Thunderbolt port?</h3>

A Thunderbolt is known to be used in systems by users. It is one that helps its users to be able to use one cable to have an access to a high-speed and high-resolution media.

This is often done by using one port along with a cable that is able to access both DisplayPort and PCI Express. Thunderbolt is known to contain technology that has been built into it that helps PCI Express speed to come in a good and better way.

Learn more about ports  from

brainly.com/question/10097616

4 0
2 years ago
Lost passwords set for documents in Microsoft® Word® documents can be retrieved in the backstage view. True False
Nat2105 [25]

Answer:

True

Explanation:

Hope this helped!

3 0
3 years ago
Read 2 more answers
A Supermarket manager hired one packager who can pack 15 boxes every two minutes. Ater some time the manager noticed that packag
Semenov [28]

Answer:

40mn

Explanation:

500/t=15/2+15/3

500/t=75/6

75t=500×6

t=3000/75

t=40

6 0
3 years ago
Read 2 more answers
Anybody remember that football game that everyone used to play during school
fiasKO [112]

Answer:

Like an actual video game or the one where you would play during recess then get in trouble when someone got hurt

Explanation:

6 0
3 years ago
Where is the Name Manager dialog box found?
Sonbull [250]
 The Name Manager<span> dialog box is found, on the </span>Formulas<span> tab, in the </span>Defined Names<span> group, click </span>Name Manager<span>.</span>
6 0
3 years ago
Other questions:
  • Cari brought 2 pounds of grapes at the grocery store she ate 5 ounces of the grapes on way home what is the weight of the grapes
    12·1 answer
  • whats something that u want to do but ur parents wont allow it like having a phone or going to a college ​
    11·2 answers
  • ____, developed by xuejia lai and james massey, is a block cipher that operates on 64-bit blocks of plaintext.
    10·1 answer
  • Which of the following attributes of a website indicates a more reliable source for information?
    8·1 answer
  • Identify the careers that require a college degree
    9·1 answer
  • NEED FIVE QUESTIONS ANSWERED!!!
    7·1 answer
  • MULTIPLE CHOICE:
    15·1 answer
  • FREEFREEFREEFREEFREEFREE
    11·2 answers
  • Computing devices translate digital to analog information in order to process the information
    12·1 answer
  • How to print<br> 1<br> 321<br> 54321<br> 7654321<br> triangle pattern in python
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!