Introduction: Python Programming - Environment Setup
This is the first instructable in this Python programming series!
The series will be an extensive introduction to the Python programming language and many topics will be covered.
Here are some of the topics that will be covered:
A. Introduction to Python and the programming environment.
B. Python Basics (Logical operators, arithmetic, indexing, slicing,...)
C. Elementary Data Structures (Lists, Tuples, Dictionaries,...)
D. Control Structures.
E. Methods and Functional Programming.
and way more!
Step 1: Is This Series for You? Why Python?
The primary objective of this course is to learn Python, and everyone is welcome to join.
Having prior programming knowledge in other programming languages (C/C++/Java) is preferred. However, for the absolute beginner, some concepts, such as object oriented programming, might be challenging. Do not let this discourage you because anything can be accomplished with time and dedication. A helpful tip would be to research any concept that you do not thoroughly understand, and there are many resource available online for free.
So why Python?
There are a myriad number of programming languages and each of them is used based on the application at hand. A programming language is simply a tool utilized to write a series of instructions for the computer to perform in order to solve a certain problem. Python is a powerful language and it is known for its simplicity and ease of use. Also, the core philosophy of Python is summarized in the The Zen of Python, which is shown in the second attached figure.
The theme of this series is the development of problem solving, which is a crucial skill that can be transferred to any other language.
Python 3 vs. Python 2
In this series, we will be using Python 3 and it was released in 2008, and is under active development.
Python 3 includes better Unicode support and more consistent features.
Step 2: Environment Setup
We need to install Python 3.5 and PyCharm Community Edition.
1. Determine which version of Windows/Mac OS you are using.
2. Install Python 3.5
Note: For Windows users, make sure to check the option "Add Python to PATH."
3. Install PyCharm Community Edition
Step 3: The Python Interpreter and Hello World!
1. Start PyCharm and run the Python Console.
Tools --> Python Console
Now, you can type Python code directly to the console after the '>>>' prompt.
2. Here are some examples you can run:
>>> 5 + 3
>>> print('Hello World')
- For help, you can simply type:
- To get help on the print function, you can type:
- And to quit in order to go back to the interpreter
help > quit
Have fun with this.
Step 4: Integrated Development Environment (IDLE)
Once you install Python, IDLE, a standard Python development environment, is installed as well.
IDLE includes a Python shell window, which grants us an access to the Python interactive mode.
For Mac, you can launch terminal and type in Python 3
For Windows, go to the Python 3 folder, then press IDLE (Python GUI)
Note: Make sure you are accessing Python 3.5.
It is recommended to use the PyCharm Community Edition instead.
Step 5: What's Next?
This sums it up for the introduction to Python and the programming environment.
Stay tuned for the second release of this series, which will cover the basics of Python (more coding).
You are encouraged to leave any comments, questions or concerns in the comments section.