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

Section-C (A) Supply the correct form of the verbs in brackets : (i) Fortune Favors (Favour) the brave. (ii) Our school..uns. (run) from 7.30 to 12.30. (iii) He
last week, 73% of tickets sold at a cinema were adult tickets. what percentage of the tickets sold were not adult tickets. (a step by step answer would be great
text about lebanon's drinking water​
factorise 2y³+y²-2y-1please tell me fast​
Iodine-131 is used to treat a hyperactive thyroid gland. the half-life of iodine 131 is 8.02 d. If a hospital receives a 215.25 g shipment of iodine 131, how mu
Work out the value of 1 squared 2 cubed 3 to the power of 4
the last time i visited aswan ............ in 2017
Acellus Business Math Question! ​
The length of a cinema hall is 20 m and breadth is 16 m. The sum of the areas of floor and flat roof is equal to the areas of four walls. Find the height of the
A pencil is 712 inches long. How long is the pencil in centimeters?