This is a concise Python 3 programming tutorial, aimed at researchers and practitioners with no prior programming experience, as well as people with previous programming skills who just want to learn Python.
I try to show everything with simple code examples; there are no long and complicated explanations with fancy words.
This tutorial is composed in a basic part, aimed at people with no programming experience at all or very little programming experience, and an advance one for people who want to learn more about python.
If you have programmed a lot in the past using some other language you may want to read the official tutorial also.
You can use Python 3.6 or any newer Python with this tutorial. Don't use Python 2.
If you write a Python 2 program now someone will need to convert it to Python 3 later, so it's best to just write Python 3 to begin with.
Python 3 code will work just fine in Python 4, so you don't need to worry about that. Python 2 also has horrible Unicode problems, so it's difficult to write Python 2 code that works correctly with non-English characters (like π and ♫).
Python is nowadays considered as "the" language of choice for Data Science. There are many reasons for that, and many articles have been written on the subject. This article looks like a good and clear example on the topic.
Q:
Yes, ok.. but.. is this a tutorial on Data Science?A:
No. This is a tutorial on Python programming. The perspective though is of a wanna-be data scientists.
I know it may sounds confusing, therefore I quickly sketched what I had in mind for this tutorial to clarify ;-)
_ Hope this mind-map look-alike clarifies a bit the perspective I chose when I thought about this course. _
tl,dr;
Python language features will be analysed and explained from the perspective of the Data (and so its Data Structures).
Python allows for a lot of flexibility, and this flexibility will be our swiss-knife.
For example, Python supports multiple programming paradigms at once. However, our main focuss will be data-structure oriented (a.k.a. Object Oriented), with a splash of mixed procedural and functional [1] programming too.
1
: functional programming only for the intrepid programmers of you :) See this video
The tutorial consists of three main parts:
This part will introduce to the concept of computer programming, and to the very basics of the Python programming language:
- The Way of the Program
- Variables, Statements and Expressions
- Introduction to Functions
- Setting up an editor
- Conditional Statements
Regardless you have already programmed before, using or not Python, I would suggest to take a look at this introductory section anyway. There is always time to skip, and you decide your learning pace.
Alternatively, a good starting point would be this online course: Intro to Python by Microsoft
This section will get you started with basic Python code and data structures.