t405.trans 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. Module(body=[Assign(targets=[Name(id='correct',
  2. ctx=Store())],
  3. value=Name(id='True',
  4. ctx=Load())),
  5. For(target=Name(id='x',
  6. ctx=Store()),
  7. iter=Call(func=Name(id='range',
  8. ctx=Load()),
  9. args=[Num(n=256)],
  10. keywords=[],
  11. starargs=None,
  12. kwargs=None),
  13. body=[If(test=Compare(left=Name(id='x',
  14. ctx=Load()),
  15. ops=[NotEq()],
  16. comparators=[Call(func=Name(id='ord',
  17. ctx=Load()),
  18. args=[Call(func=Name(id='chr',
  19. ctx=Load()),
  20. args=[Name(id='x',
  21. ctx=Load())],
  22. keywords=[],
  23. starargs=None,
  24. kwargs=None)],
  25. keywords=[],
  26. starargs=None,
  27. kwargs=None)]),
  28. body=[Print(dest=None,
  29. values=[Name(id='x',
  30. ctx=Load())],
  31. nl=True),
  32. Assign(targets=[Name(id='correct',
  33. ctx=Store())],
  34. value=Name(id='False',
  35. ctx=Load()))],
  36. orelse=[])],
  37. orelse=[]),
  38. Print(dest=None,
  39. values=[Str(s='chr and ord are inverses: '),
  40. Name(id='correct',
  41. ctx=Load())],
  42. nl=True),
  43. Print(dest=None,
  44. values=[Call(func=Name(id='chr',
  45. ctx=Load()),
  46. args=[Num(n=97)],
  47. keywords=[],
  48. starargs=None,
  49. kwargs=None)],
  50. nl=True),
  51. Print(dest=None,
  52. values=[Compare(left=Call(func=Name(id='chr',
  53. ctx=Load()),
  54. args=[Num(n=97)],
  55. keywords=[],
  56. starargs=None,
  57. kwargs=None),
  58. ops=[Eq()],
  59. comparators=[Str(s='a')])],
  60. nl=True)])