0% found this document useful (0 votes)
32 views

Python Week1 Lecture4 Handout

This document discusses installing and using Python 3 for programming, data structures, and algorithms. It covers downloading Python 3.5 for Linux, MacOS, and Windows from python.org. Python is an interpreted language where code is executed directly by the Python interpreter rather than being compiled. The document contrasts interpreters with compilers and provides some online resources for learning Python, including tutorials, books, and emphasizes that programming is best learned through writing and executing code.

Uploaded by

Aakanksha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Python Week1 Lecture4 Handout

This document discusses installing and using Python 3 for programming, data structures, and algorithms. It covers downloading Python 3.5 for Linux, MacOS, and Windows from python.org. Python is an interpreted language where code is executed directly by the Python interpreter rather than being compiled. The document contrasts interpreters with compilers and provides some online resources for learning Python, including tutorials, books, and emphasizes that programming is best learned through writing and executing code.

Uploaded by

Aakanksha
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

NPTEL MOOC

PROGRAMMING,
DATA STRUCTURES AND
ALGORITHMS IN PYTHON
Week 1, Lecture 4

Madhavan Mukund, Chennai Mathematical Institute


http://www.cmi.ac.in/~madhavan
Installing Python
Python is available on all platforms: Linux, MacOS
and Windows

Two main flavours of Python

Python 2.7

Python 3+ (currently 3.5.x)

We will work with Python 3+


Python 2.7 vs Python 3
Python 2.7 is a static older version

Many libraries for scientific and statistical


computing are still in Python 2.7, hence still
alive

Python 3 is mostly identical to Python 2.7

Designed to better incorporate new features

Will highlight some dierences as we go along


Downloading Python 3.5
Any Python 3 version should be fine, but the latest
is 3.5.x

On Linux, it should normally be installed by


default, else use the package manager

For MacOS and Windows, download and install


from https://www.python.org/downloads/release/
python-350/

If you have problems installing Python, search


online or ask someone!
Interpreters vs compilers
Programming languages are high level, for
humans to understand

Computers need lower level instructions

Compiler: Translates high level programming


language to machine level instructions, generates
executable code

Interpreter: Itself a program that runs and directly


understands high level programming language
Python interpreter
Python is basically an interpreted language

Load the Python interpreter

Send Python commands to the interpreter to be


executed

Easy to interactively explore language features

Can load complex programs from files

>>> from filename import *


Practical demo
Some resources
The online Python tutorial is a good place to start:
https://docs.python.org/3/tutorial/index.html

Here are some books, again available online:

Dive into Python 3, Mark Pilgrim


http://www.diveintopython3.net/

Think Python, 2nd Edition, Allen B. Downey


http://greenteapress.com/wp/think-python-2e/
Learning programming

Programming cannot be learnt theoretically

Must write and execute your code to fully


appreciate the subject

Python syntax is light and is relatively easy to learn

Go for it!

You might also like