When executing a string with exec(), it returns None.
tree_1= '''def tree():
input_user = input('elektriciteit | Y&N')
if input_user == 'Y':
return 1800000
else:
input_user = input('accelerator | Y&N')
if input_user == 'Y':
return 2170701
else:
return 2170705
tree()'''
output = exec(tree_1)
print(output)
How to save the return value to a variable. Eval is not working.