Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Beginning python programming

1,326 views

Published on

Basic overview of python for newbie

Published in: Education, Technology
  • Login to see the comments

Beginning python programming

  1. 1. Beginning Python Programming Kantesh Raj (@kanteshraj)
  2. 2. Quick QuestionName major programminglanguages taught at school orcolleges ?
  3. 3. According to my knowledge● C● C++● Java● PHP / ASP.NET (Few Places)
  4. 4. Then.... Why we need python?Lets do a simple activity for this
  5. 5. ActivityWrite a code for “Hello World”in any language you like, otherthan python
  6. 6. Hello World Program in C#include <stdio.h>main(){ printf(“Hello World”);}// No. Of Lines Of Code: 5
  7. 7. How many lines of code you wrote ?
  8. 8. Now,Hello World program in Python
  9. 9. print “Hello World”
  10. 10. What is Python?● Python is dynamic, open source programming language with a focus on simplicity and productivity.● It was developed in 1991
  11. 11. Who is he?
  12. 12. Who is he?Guido van RossumCreator of Python
  13. 13. 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
  14. 14. Can Do● System Administration● GUI programming● Web Application● Database Apps● Scientific Application● Games● Android App development
  15. 15. Getting Familiar with python● Extension for python file : .py● For example Hello.py ALiAS.py
  16. 16. No Semicolonsprint “Hello Everyone”print 2+2
  17. 17. Indentation● File: HelloWrong.py print “Hello” print “World”● File: HelloCorrect.py print “Hello” print “World”
  18. 18. No variable data type declaration x=5 print x print x*9● Python will do it for you :)
  19. 19. 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)
  20. 20. It will make your work easy● bpython● ipython
  21. 21. Demo 1Program to take input from userand print “python is awesome”, ifuser enter number less than 5otherwise print “Hello ALiAS”.
  22. 22. Demo 2● Write a function for printing value from array using for loop.● Use above function in other program by help of import.
  23. 23. Demo 3● Program to create a file in python and write “this is python basic session.”
  24. 24. Demo 4● Python program for listing file in home directory
  25. 25. 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/
  26. 26. PyConhttp://in.pycon.org/2012/
  27. 27. Any Question ?
  28. 28. About Me● Name: Kantesh Raj● Twitter: @kanteshraj● Blog: kanteshraj.blogspot.in Thank You

×