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

What improves the productivity of cellular respiration?.
part 5 Handbook of Sentence Skills Review Test 3 There are two run-ons in each passage. Correct them by using the following methods: • Period and capital letter
A student uses a pulley to lift a bucket. The pulley does not work well. Which solution will decrease the amount of friction on the pulley?
student studies the data for the population size of birds in an area over time. The stu in one statement.
cellular respiration allows organisms to release the energy stored in the chemical bonds of glucose. the energy in glucose is used to produce ATP, which cells u
Betty sets up a lemonade stand and charges $1 per glass. It cost her $50 to set up the stand. Which function gives the profit, p, she makes by selling g glasses
Please help have a nice day please attach a file​
5x = 40 what does the x going to equal
A geologist visits 40 volcanoes in Alaska and California. 15% of the volcanoes are in California. How many volcanoes does the geologist visit in California and
The assassination of Julius Ceasar What would be the Actus Reus in this case? Please please help thank you ♡