Problem: Say “Hello, World!” With Python
Solution 1
Here is a sample line of code that can be executed in Python:
1
2
3
4
5
print("Hello, World!")
# or
if __name__ == '__main__':
print ("Hello, World!")
Solution 2
You can just as easily store a string as a variable and then print it to stdout:
1
2
my_string = "Hello, World!"
print(my_string)
The above code will print Hello, World! on your screen. Try it yourself in the editor!