Hey I have been messing around on Python and I need to know if there is a way of testing if the output of a Python Script equals something. Heres what I have been trying:
a = """
print("Hey")
b = 5
print(str(b+5))
"""
if str(exec(a)) == "Hey\n10":
print("True")
It just prints out the answer of executing 'a'.
What am I doing wrong?