0
Better ideas for this code?
import random a=1 while a>0 print(random.randint(0,1000000)) print("your phone does not like this")
5 Respuestas
+ 2
Using a variable to get an infinite loop is not necessary, you can just use
while 1:
The other possibility is to use
while True:
+ 2
If you mean the syntax error, put a colon on:
while a>0:
If you aren't multi threading use Pierre's answer.
=====
Otherwise it's useful for multithreading:
http://stackoverflow.com/a/19790803/3981745
So you could stop it, and it's faster than an additional check in the loop.
+ 1
While(a < 100):
a=a+1
Print ""
0
how could i improve it?
0
is seams that it doesn't work for me... Pierre Varlez