In C, I'd do something like
int main() {
    return 42;
}
and after executing the program, I can(in Linux) prompt echo $? to the console to get the desired 42 as the return signal from the last operation. How can I do that in python?
I tried just creating a file with a return 42 in it, but it says that it is not inside a function(obviously).
 
    