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
vovikov84 [41]
1 year ago
7

write a recursion (a function) sum list (nums) that calculates the sum of numbers in a list, the parameter nums is a list of int

egers. if the list is empty, it should return none.
Computers and Technology
1 answer:
Mamont248 [21]1 year ago
7 0

def eval(n):

   return n[0] + eval(n[1:]) if n else 0

   

list = []

idx = int(input("How many elements will you append?: "))

for i in range(idx):

   tmp = int(input("Enter a number: "))

   list.append(tmp)

   

print("The sum of the list is:",eval(list))

You might be interested in
Distancelearning has got a boost due to the ___________.
Alona [7]

Answer: All of the above

Explanation: Distance learning which is also known as distance education/online learning  in which the education is provided via online lectures, online classes or e-learning .Students are provided recording of the lectures or online tutoring is given.This learning is helpful to many people who having issues like can only study in weekend, can study only after work/job,etc.

This is a flexible way of providing education and communication is also easy in it as the student can watch the video lecture whenever they want.The content of the lecture is also interactive so that student can understand it easily and no doubts arise.

5 0
4 years ago
How long does a seller have to ship an item on offerup
ra1l [238]

They have up to six days to ship the item after it has been purchased via either the Buy Now option or them accepting an offer.

7 0
2 years ago
What affect does the corona virus have the United States economy
Readme [11.4K]

Answer:

It can disturb the worldwide stock of products, making it harder for U.S. firms to take care of requests. It can likewise waylay laborers in influenced regions, diminishing work supply toward one side and on the other moderate the interest for U.S. items and administrations. The monetary interruptions brought about by the infection and the expanded vulnerability are being reflected in lower valuations and expanded instability in the money related markets. While the specific impact of the coronavirus on the U.S. economy is obscure and mysterious, obviously it presents colossal dangers. Corona will most legitimately shape monetary misfortunes through inventory chains, request, and budgetary markets, influencing business speculation, family unit utilization, and global exchange. The infection won't just influence supply, yet a few parts of the U.S. economy may likewise encounter decreases sought after—and enormous decreases in income—in light of the general consequences for the economy. More households are in debt and are not able to purchase the things they would normally purchase without a fixed budget

-Hope this helps

6 0
3 years ago
When a machine on the public network wants to reach the server at 172.30.0.10, which ip will it use?
Anton [14]
The IP address that it will use is 192.168.16.100
3 0
4 years ago
Read 2 more answers
Are the ways data is represented and transmitted with computers laws of nature or laws of man?
puteri [66]
I believe the correct answer is Laws of Man
4 0
3 years ago
Other questions:
  • Which model is the oldest and most common technique of differentiating information systems?
    8·2 answers
  • Which of the following occurs when the amount of money earned is greater than the
    5·1 answer
  • Which of the following solutions enables simultaneous digital transmission of voice, video, data, and other network services ove
    7·1 answer
  • What describes the time it takes a packet to move from one designated on the network to
    7·1 answer
  • Does anyone know how to connect a nintendo switch to a laptop?
    10·2 answers
  • (Giving brainliest to best answer, don't make an answer if you don't know or its jumble)
    11·2 answers
  • When the function below is called with 1 dependent and $400 as grossPay, what value is returned?
    13·1 answer
  • Which is a concept of the CIA of Computer Security
    7·1 answer
  • Consider legal issues and intellectual property concerns when creating computer programs?
    11·1 answer
  • Which of the following is NOT true about a USB stick?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!