How to print "Hello, world!" (in every possible way)
- by Attila Oláh
Here's what I', trying to do:
1 language: (Python < 3):
print "Hello, world!"
2 languages: (Python < 3 & Windows Shell, aka .bat file):
rem="""
echo "Hello, world!"
exit
"""
print "Hello, world!"
Next step could be something like bash. Since the above one raises an exception, I tried to make it not raise exceptions, like this:
rem="""
echo "Hello, world!"
exit
"""
exit=""
exit
print "Hello, world!"
The only issue is, of course, it won't print the hello world. And I really want it to print that hello world for me. Anyone can help with this?
Also, any other language would do it, just don't break the previous ones (i.e. the answer still has to be valid Python code and print out the nice hello world greeting when run with Python.)
Any ideas are welcome.
I'm making this a community wiki so feel free to add ideas to the list.