Beginning python programming
Upcoming SlideShare
Loading in...5
×
 

Beginning python programming

on

  • 849 views

Basic overview of python for newbie

Basic overview of python for newbie

Statistics

Views

Total Views
849
Views on SlideShare
849
Embed Views
0

Actions

Likes
1
Downloads
56
Comments
2

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as OpenOffice

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Beginning python programming Beginning python programming Presentation Transcript

  • Beginning Python Programming Kantesh Raj (@kanteshraj)
  • Quick QuestionName major programminglanguages taught at school orcolleges ?
  • According to my knowledge● C● C++● Java● PHP / ASP.NET (Few Places)
  • Then.... Why we need python?Lets do a simple activity for this
  • ActivityWrite a code for “Hello World”in any language you like, otherthan python
  • Hello World Program in C#include <stdio.h>main(){ printf(“Hello World”);}// No. Of Lines Of Code: 5
  • How many lines of code you wrote ?
  • Now,Hello World program in Python
  • print “Hello World”
  • What is Python?● Python is dynamic, open source programming language with a focus on simplicity and productivity.● It was developed in 1991
  • Who is he?
  • Who is he?Guido van RossumCreator of Python
  • Python● Interpreter Based language● Designed to be easy to learn and master -> clear syntax -> Very few keyword● Highly portable -> Run on all platform(OS)● Large set of library -> libraries for huge number of software
  • Can Do● System Administration● GUI programming● Web Application● Database Apps● Scientific Application● Games● Android App development
  • Getting Familiar with python● Extension for python file : .py● For example Hello.py ALiAS.py
  • No Semicolonsprint “Hello Everyone”print 2+2
  • Indentation● File: HelloWrong.py print “Hello” print “World”● File: HelloCorrect.py print “Hello” print “World”
  • No variable data type declaration x=5 print x print x*9● Python will do it for you :)
  • Input from keyboard● Function for that: raw_input()● It always return string type● Example: x=raw_input(“Enter number”) print x y=int(x)+2 print y print “the final value is ”+str(y)
  • It will make your work easy● bpython● ipython
  • Demo 1Program to take input from userand print “python is awesome”, ifuser enter number less than 5otherwise print “Hello ALiAS”.
  • Demo 2● Write a function for printing value from array using for loop.● Use above function in other program by help of import.
  • Demo 3● Program to create a file in python and write “this is python basic session.”
  • Demo 4● Python program for listing file in home directory
  • Where to refer ?● Python Website: documentation http://www.python.org/● Dive into python:ebook http://www.diveintopython.net● How to think like a computer scientish: ebook http://www.greenteapress.com/
  • PyConhttp://in.pycon.org/2012/
  • Any Question ?
  • About Me● Name: Kantesh Raj● Twitter: @kanteshraj● Blog: kanteshraj.blogspot.in Thank You