ktie7488 ktie7488
  • 01-01-2021
  • Computers and Technology
contestada

Write a while loop that prints user_num divided by 2 until user_num is less than 1. The value of user_num changes inside of the loop. Sample output for the given program:

Respuesta :

Cytokine
Cytokine Cytokine
  • 01-01-2021

user_num = 20

while user_num>= 1:

   print(user_num,"divided by 2 =",user_num/2)

   user_num /= 2

I wrote my code in python 3.8. I hope this helps.

Answer Link

Otras preguntas

how is mass transit in cities a possible solution tk urban air pollution?
Scarcity is the condition of not having enough goods and services to satisfy everyone's?
How is it possible for Mercury to have frozen ice ?
Scarcity is the condition of not having enough goods and services to satisfy everyone's?
How were life forms affected by the rise in atmospheric oxygen levels that began 2.2 billion years ago?
Can someone use the word delta in a sentence
Scarcity is the condition of not having enough goods and services to satisfy everyone's?
Prove that (x^5)-(x^2)+2x +3=0 has at least one real root. Prove that x=cosx has at least one solution.
Scarcity is the condition of not having enough goods and services to satisfy everyone's?
Find Domain of the functionsquare root of (x-8)/x(x-9)