lisbethv0225 lisbethv0225
  • 08-12-2020
  • Computers and Technology
contestada

Write a program where you print this sequence.

1

3

5

7

9

Respuesta :

Cytokine
Cytokine Cytokine
  • 08-12-2020

init = 1

choice = int(input("How far into the sequence would you like to go to? "))

i = 0

while i < choice:

   print(init)

   init += 2

   i += 1

If you enter 5, you'll get 1,3,5,7,9. You can also go to whatever place in the sequence you want. I wrote my code in python 3.8. Hope this helps

Answer Link

Otras preguntas

True or false: The term stakeholders refers only to those who own stock in a company.
what is 3/4 of 1/2?________
hey guys whats obamas last name agian?
How did James Oglethorpe gain the friendship of Tomochichi and the Yamacraw Indians, leading to the founding of Savannah?Question 7 options:Mary Musgrove, who w
Read the following paragraphs and determine which sentences should be omitted in order to maintain paragraph unity. (1) Adults visit amusement parks for several
No. 22 please help me with the answer! Thank you!
How to solve 20.0 mL/ 5.7 g with significant figures and including units
What is the reciprocal of -11/30 in a fraction
Can someone help me with this proof
What are lichens? What are lichens? What are lichens? What are lichens? What are lichens?