I've seen two ways to create an infinite loop in Python:

  1. while 1:
        do_something()
    
  2. while True:
        do_something()
    

Is there any difference between these? Is one more pythonic than the other?

Edit
Report