fork download
  1. import os, base64
  2. def showme(s):
  3. b64_1 = base64.b64encode("p" + "rint(" + s + ")")
  4. exec(base64.b64decode(b64_1))
  5. print("This is the first test.\n")
  6. showme("This is the second test.")
Runtime error #stdin #stdout #stderr 0.02s 28008KB
stdin
Standard input is empty
stdout
This is the first test.

stderr
Traceback (most recent call last):
  File "./prog.py", line 6, in <module>
  File "./prog.py", line 3, in showme
  File "/usr/lib/python3.5/base64.py", line 59, in b64encode
    encoded = binascii.b2a_base64(s)[:-1]
TypeError: a bytes-like object is required, not 'str'