doodlebug9276 doodlebug9276
  • 07-01-2021
  • Computers and Technology
contestada

Write a while loop that prints userNum divided by 2 (integer division) until reaching 1. Follow each number by a space. Example output for userNum

Respuesta :

Cytokine
Cytokine Cytokine
  • 07-01-2021

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

while userNum > 1:

   print(userNum, end=" ")

   userNum /= 2

I wrote my code in python 3.8. I think this is what you want but I'm not too sure. I'll change the code if you need me to.

Answer Link

Otras preguntas

Any substance that yields a hydrogen ion when placed in a water solution is called a(n) _____. A) acid B) base
Explain the functional significance of the differences in epithelia types between the three pharyngeal regions.
is Tiene mucho calor hoy. correct
How do geneticists use a two- point cross to detect linkages?
4. In a triangle, let P be the location where two angle bisectors meet. Must P be on the third angle bisector as well? Explain your reasoning.
what is an earthquake
Beer Production For the various steps of beer production, match the descriptions of the process with the terms for the steps. Some responses may be used more th
Leah is interested in helping her daughter learn manners. Each time her daughter says something that is close to appropriate, she rewards her. Eventually, her d
The zinc replaced the copper ion. Therefore, the other product is Zinc Oxygen Iron sulfate Zinc sulfate
What has happened if a blighted urban neighborhood were to suddenly develop an assortment of upscale restaurants, coffee shops, hip boutiques, and art galleries