Home » Python » Hello World in Python [duplicate]

Hello World in Python [duplicate]

Posted by: admin November 1, 2017 Leave a comment

Questions:

This question already has an answer here:

Answers:
print("Hello, World!")

You are probably using Python 3.0, where print is now a function (hence the parenthesis) instead of a statement.

Questions:
Answers:

Unfortunately the xkcd comic isn’t completely up to date anymore.

https://imgs.xkcd.com/comics/python.png

Since Python 3.0 you have to write:

print("Hello world!")

And someone still has to write that antigravity library 🙁

Questions:
Answers:

In python 3.x. you use

print("Hello, World")

In Python 2.x. you use

print "Hello, World!"