samedi 12 septembre 2020

Why is my code in python not giving an output at all?

I wrote some code in python to see how many times one number can be divided by a number, until it gets a value of one.

counter_var = 1
quotient = num1/num2

if quotient<1:
    print('1 time')
else:
    while quotient >= 1:
        quotient = num1/num2
        counter_var =  counter_var + 1
    print(counter_var)

It is not ending the process but neither is it giving any output.

Aucun commentaire:

Enregistrer un commentaire