fork download
  1. import random
  2. comments = [' ',' ',' #this is a loop',' #is this tehcnically a quine?',' #small optimization']
  3. code = ['import random','comments = ','code = ','code[2] = code[2] + str(code)','code[1] = code[1] + str(comments)','for i in code:',' print(i + random.choice(comments))']
  4. code[2] = code[2] + str(code)
  5. code[1] = code[1] + str(comments)
  6. for i in code:
  7. print(i + random.choice(comments))
Success #stdin #stdout 0.02s 11496KB
stdin
Standard input is empty
stdout
import random #is this tehcnically a quine?
comments = [' ', ' ', ' #this is a loop', ' #is this tehcnically a quine?', ' #small optimization'] #this is a loop
code = ['import random', 'comments = ', 'code = ', 'code[2] = code[2] + str(code)', 'code[1] = code[1] + str(comments)', 'for i in code:', '    print(i + random.choice(comments))'] 
code[2] = code[2] + str(code) #small optimization
code[1] = code[1] + str(comments) 
for i in code: #small optimization
    print(i + random.choice(comments)) #this is a loop