line1 = "class A:\n\tpass"
line2 = "class B:\n\tpass"
line3 = "class C:\n\tpass"
line4 = "print(issubclass(C,A) and issubclass(C,B))"
exec(line1...4)
results in "False"
printed to the console, as it should be.
However, if I then:
myList = [str(exec(line4))]
print(myList)
The string in myList is "None"
, where I'd like it to be "False"
as printed on the console.
I've tried aVariable = exec(line4)
but this also prints "None".
Any help welcome.
I'm new to Python and I feel like there's a nuance I'm missing.
Thanks in advance!