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

Transforme em voz passiva: They don't speak English in this shop
Transforme em voz passiva: They don't speak English in this shop
Passe para a voz passiva:- Kevin asked Dennis a question-Somebody Build the house last year-She gives him a box
Transforme em voz passiva: They don't speak English in this shop
Responde a las preguntas: ¿Cómo te llamas? ¿De dónde eres? ¿A qué te dedicas? ¿Tienes hermanos?
Transforme em voz passiva: They don't speak English in this shop
Transforme em voz passiva: They don't speak English in this shop
Transforme em voz passiva: They don't speak English in this shop
Conjuga los siguientes verbos en presente y preterito indefinido: SER, ESTAR, HACER.
Passe para a voz passiva:- Kevin asked Dennis a question-Somebody Build the house last year-She gives him a box