t419.trans 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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=[Str(s="ord('a') = "),
  45. Call(func=Name(id='ord',
  46. ctx=Load()),
  47. args=[Str(s='a')],
  48. keywords=[],
  49. starargs=None,
  50. kwargs=None)],
  51. nl=True),
  52. Print(dest=None,
  53. values=[Compare(left=Call(func=Name(id='ord',
  54. ctx=Load()),
  55. args=[Str(s='a')],
  56. keywords=[],
  57. starargs=None,
  58. kwargs=None),
  59. ops=[Eq()],
  60. comparators=[Num(n=97)])],
  61. nl=True)])