fork download
  1. def enum(x):
  2. globals().update(map(reversed, enumerate(x.split())))
  3.  
  4. enum("""
  5. NULL
  6. ONE
  7. TWO
  8. THREE
  9. FORTH
  10. """)
  11.  
  12. print(NULL, ONE, TWO, THREE, FORTH)
Success #stdin #stdout 0.02s 27712KB
stdin
Standard input is empty
stdout
0 1 2 3 4