Serenaark6707 Serenaark6707
  • 02-07-2021
  • Computers and Technology
contestada

Write code using the range function to add up the series 3, 6, 9, 12, 15, ..... 66 and print the resulting sum. Expected Output 759

Respuesta :

MrRoyal
MrRoyal MrRoyal
  • 08-07-2021

Answer:

The program is as follows:

total = 0

for i in range(3,67,3):

   total += i    

print(total)

Explanation:

This initializes the sum of the series to 0

total = 0

This iterates through the series with an increment of 3

for i in range(3,67,3):

Add up all elements of the series

   total += i

Print the calculated sum    

print(total)

Answer Link

Otras preguntas

What is my GPA (Highschool) *The first class is a B*The last class is a C*
Who helped fight against russia in the crimean war?
Why is the structure of a speech like an emotional journey? A: It takes the listener through various states of mind to a final emotional state B: It can be seri
Why did some Arab countries cut off oil shipments to the United States during the Arab-Israeli war? A) because the United States was providing aid to Isra
Being a Federal government means: A.Power is solely responsible at the national level B.The National and States share power C.The States have all the power D.P
A retrotransposon known as Alu1 is about 300 base pairs in length and is present in the human genome in about 1 million copies. Approximately what percentage of
Ba-3 what does a red flag with a diagonal white stripe mean?
Which trend caused progressives to work for urban reform in the late 19th century?
Former slaves who were released from slavery were called:
Which renewable energy more effecient than the other and not limited