YouTip LogoYouTip

Python3 Tutorial

# Python3.x Python 3 Tutorial ![Image 2: python3](#) Python's version 3.0, often referred to as Python 3000 or Py3k for short, is a major upgrade from earlier versions of Python. To avoid carrying too much baggage, Python 3.0 was designed without considering backward compatibility. We have already covered the introduction and installation of Python in the [Python 2.X version tutorial](#), so we will not repeat it here.[](#) (#)[Differences between Python2.x and 3.x versions](#) to see the differences between the two. This tutorial is mainly for learning the Python 3.x version. If you are using Python 2.x, please go to the [Python 2.X version tutorial](#). **Official announcement: Python 2 updates will stop on January 1, 2020.** * * * ## Check Python Version We can use the following command in the command window (Windows uses win+R to open the cmd run box) to check the Python version we are using: python -V or python --version The result of the above command is as follows: Python 3.3.2 You can also enter Python's interactive programming mode to check the version: Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600 32 bit (Intel)] on win32 Type "copyright", "credits" or "license()" for more information.>>> * * * ## First Python3.x Program For most programming languages, the first introductory code is **"Hello World!"**. The following code uses Python to output **"Hello World!"**: ## hello.py file code: #!/usr/bin/python3 print("Hello, World!") [Run Example Β»](#) Python commonly uses the .py file extension. You can save the above code in a **hello.py** file and use the python command to execute the script file. $ python3 hello.py The output of the above command is: Hello, World!
← Python3 InterpreterPython 2X 3X β†’