92717/how-divide-number-another-multiple-times-untill-will-about
How to divide one number to another multiple times, until it will be about 0?
For example 128 / 2, then 64 / 2, then 32/2, and so on. Please help me, how can I write the cycle?
You can do something like this:
while num != 0: num//=2 print(num)
In the num, you could put any num, e.g, num=128
r you could ask the User for an input
To see the output use a print(num) statement
If you only have one reference to ...READ MORE
You can find the explanation and implementation ...READ MORE
The following code snippet might solve your ...READ MORE
Hello @kartik, You could use assign with a dict of ...READ MORE
You can also use the random library's ...READ MORE
Syntax : list. count(value) Code: colors = ['red', 'green', ...READ MORE
Enumerate() method adds a counter to an ...READ MORE
You can simply the built-in function in ...READ MORE
Try using os.system: os.system("script2.py 1") execfile is different because it is ...READ MORE
You can go through this: def num(number): ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.