goldie7130 goldie7130
  • 30-11-2020
  • Computers and Technology
contestada

Write a Python program segment, using a loop, to calculate and print the sum of the odd integers from 20 to 120. (Hint: 21 23 25 . . . 117 119)

Respuesta :

Jayhawker6
Jayhawker6 Jayhawker6
  • 30-11-2020

Answer:

for x in range(20,120):

   if x % 2 == 0:

       continue

   print(x)

Explanation:

in a range of 20 to 120 it does the following, if x is divisible by two as an int, then try again with a new number. If not, print that number.

Answer Link

Otras preguntas

what can the reader learn about by studying the implicit meanings of words in a poem? A. the poems theme B. the poems meter C. the poems rhyme scheme D. the poe
An allocation base that causes overhead costs to be incurred is called a(n):
If you flip a fair coin 3 times what are the chances you will get all heads
How did Israel react to the Egyptians, Syrians and Jordanians massing soldiers on its border?
What is the graph of x = -5?
Choose the conjugation that correctly completes the sentence Tú _____ el agua. bebo bebes bebe beben
The population of Glendale this year is 3,200 more than half of last year’s population. The population this year is 26,300. Which equation could be solved to fi
In the early years of the industrial revolution factory owners paid women ___ higher wages the same wages as men lower wages then men in material goods and fo
A turtle is 20 5/6 inches below the surface of a pond. It dives to a depth of 32 1/4 inches. What is the change in the turtle’s position?
How many different arrangements of the letters in the word SCHOOL are there? A) 1440 B) 720 C) 360 D) 120