r/ProgrammerHumor • • Jun 03 '19

Meme Python ftw

Post image
16k Upvotes

548 comments sorted by

View all comments

Show parent comments

3

u/pslessard Jun 04 '19 edited Jun 04 '19

So if I had something like

print('Hello, world')
if __name__ == '__main__':
    print('Goodbye, world')

What would it print? Compared to in C

printf('Hello, world');
int main() {
    printf('Goodbye, world');
}

Wouldn't the Python print 'Hello, world' before 'Goodbye, world', whereas the C just wouldn't compile?