hands on session on python

Download Hands on Session on Python

If you can't read please download the document

Upload: sumit-raj

Post on 16-Apr-2017

1.585 views

Category:

Education


0 download

TRANSCRIPT

SNAKES ON THE WEB:- Python

Sumit Raj

A hands on session on Python

- needs Software Freedom Day@Alexandria University

Contents

What is Python ???

Why Python ???

Who uses Python ???

Running Python

Syntax Walkthroughs

Strings and its operations

Loops and Decision Making

List, Tuple and Dictionary

Functions, I/O, Date & Time

Modules , File I/O

Sending a mail using Python

Coding Mantras

What is Python ???

General purpose, object-oriented, high level programming language

Widely used in the industry

Used in web programming and in standalone applications

History

Created by Guido von Rossum in 1990 (BDFL)

Named after Monty Python's Flying Circus

http://www.python.org/~guido/

Blog http://neopythonic.blogspot.com/

Now works for Dropbox

Why Python ???

Readability, maintainability, very clear readable syntax

Fast development and all just works the first time...

very high level dynamic data types

Automatic memory management

Free and open source

Implemented under an open source license. Freely usable and distributable, even for commercial use.

Simplicity, Availability (cross-platform), Interactivity (interpreted language)

Get a good salaried Job

Batteries Included

The Python standard library is very extensive regular expressions, codecs

date and time, collections, theads and mutexs

OS and shell level functions (mv, rm, ls)

Support for SQLite and Berkley databases

zlib, gzip, bz2, tarfile, csv, xml, md5, sha

logging, subprocess, email, json

httplib, imaplib, nntplib, smtplib

and much, much more ...

Who uses Python ???

Hello World

print Hello World!

In addition to being a programming language, Python is also an interpreter. The interpreter reads other Python programs and commands, and executes them

Lets write our first Python Program

Python is simple

print "Hello World!"

#include int main() { cout