This is part of my Python & Django Series which can be found here including information on how to download all the source code.
What Is Python?
Python is a high level, dynamically typed and interpreted language. It was created by Guido van Rossum between 1985 and 1990. It is available under the GNU General Public License (GPL)
It is Multi-paradigm:
It has a very large and extensive library, called the standard library, and it also ships with an interactive command line which allows developers to run, poke and test code!
Python has grown in popularity over the years and is today highly regarded as a general purpose programming language. It is used for application development, install/maintenance scripts, OpenStack, REST web services and web development.
Python comes pre-installed on Linux, BSD and BSD Copies dig. If you are running Windows or perhaps would like to upgrade to a later version you can download installers here..
Python can be coded in any text editor or a dedicated IDE. There are many choices available though I personally use and recommend PyCharm. There is a free community edition which will provide enough functionality for learning the basics of the language.
- Running code directly from the IDE
- Interactive Python command line
- Terminal output
- Code completion
- Code highlighting
- Code navigation
API reference and more information on Python can be found at Python.Org Docs.
Python is a lot of fun and very simple to start coding in; unlike C#, C++ or Java a Hello World Program can be written in one line!
print("Really? Surely you can think of something better than a Hello World program?")
Python is dynamic, you don’t need to define the data type when creating a variable. Simply the name of the variable along with the assignment of the data. Python will work out the best data type for the data before creating it in memory . Upon changing the data, if a new data type is required, Python will automatically change the type for you!
value = "No I cannot, that is why I am a programmer" print(type(value)) value = 1 print(type(value)) value = True print(type(value))
<class 'str'> <class 'int'> <class 'bool'>
Python aims to be a language which is easy and quick to learn and use. This becomes apparent when looking at the basic data types, which are kept at a minimum.
|str||Textual data||aString = “Hello”|
|bool||True or False||aBool = True|
|int||Integrals||anInt = 1|
|float||Floating point numbers||aFloat = 1.0|
|decimal||Deciamal numbers||aDecimal = Decimal(1.0)|