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

Solve the following system by substitution. m+n=5 and 5m+5n=25. Solve.​
please help thank you
Which was not a challenge faced by America during the start of World War I? Establishing boarders with Canada and Mexico Recovering from economic problems Buil
What was the name of Pershing’s group
How does changing the pressure affect the chemical reaction?
Picture Perfect Marie Devers 1At the first yearbook meeting, I quietly sat in the back of the classroom and hardly said anything. Unlike the other yearbook-clu
Please help me ASAP !!!!
The speaker in "If" says that those who follow the advice offered in the poem will become foolish mature clever fortunate
Please help and thank you
Fill in the blank please
good job