t400.trans 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. Module(body=[Import(names=[alias(name='random',
  2. asname=None)]),
  3. Expr(value=Call(func=Attribute(value=Name(id='random',
  4. ctx=Load()),
  5. attr='seed',
  6. ctx=Load()),
  7. args=[Num(n=0)],
  8. keywords=[],
  9. starargs=None,
  10. kwargs=None)),
  11. Assign(targets=[Name(id='lst',
  12. ctx=Store())],
  13. value=List(elts=[Num(n=0),
  14. Num(n=0),
  15. Num(n=0),
  16. Num(n=0),
  17. Num(n=0)],
  18. ctx=Load())),
  19. For(target=Name(id='i',
  20. ctx=Store()),
  21. iter=Call(func=Name(id='range',
  22. ctx=Load()),
  23. args=[Num(n=1000)],
  24. keywords=[],
  25. starargs=None,
  26. kwargs=None),
  27. body=[AugAssign(target=Subscript(value=Name(id='lst',
  28. ctx=Load()),
  29. slice=Index(value=Call(func=Attribute(value=Name(id='random',
  30. ctx=Load()),
  31. attr='randint',
  32. ctx=Load()),
  33. args=[Num(n=0),
  34. Num(n=4)],
  35. keywords=[],
  36. starargs=None,
  37. kwargs=None)),
  38. ctx=Store()),
  39. op=Add(),
  40. value=Num(n=1))],
  41. orelse=[]),
  42. Print(dest=None,
  43. values=[Name(id='lst',
  44. ctx=Load())],
  45. nl=True),
  46. Print(dest=None,
  47. values=[Call(func=Name(id='sum',
  48. ctx=Load()),
  49. args=[Name(id='lst',
  50. ctx=Load())],
  51. keywords=[],
  52. starargs=None,
  53. kwargs=None)],
  54. nl=True)])