What is Python?


Published on

  • Be the first to comment

  • Be the first to like this

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

What is Python?

  1. 1. Disclaimer:This presentation is prepared by trainees ofbaabtra as a part of mentoring program. This is not officialdocument of baabtra –Mentoring PartnerBaabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt .Ltd
  2. 2. PYTHON Ashwin Anand V Email/facebook id:ashwinanand99@gmail.com
  3. 3.  Created in 1991 by Guido Van Rossum
  4. 4. What is Python?• A programming language with strong similarities to PERL, but with powerful typing and object oriented features. – Commonly used for producing HTML content on websites. Great for text files. – Useful built-in types (lists, dictionaries). – Clean syntax, powerful extensions.
  5. 5. Use an integrated development environment (IDE) Source file Execution shell
  6. 6. Why Python?• Natural Language Tool Kit• Ease of use; interpreter• AI Processing: Symbolic – Python’s built-in data types for strings, lists, and more. – Java or C++ require the use of special classes for this.• AI Processing: Statistical – Python has strong numeric processing capabilities: matrix operations, etc. – Suitable for probability and machine learning code.
  7. 7. Compiling and interpreting• Many languages require you to compile (translate) your program into a form that the machine understands. compile execute source code byte code output Hello.java Hello.class• Python is instead directly interpreted into machine instructions. interpret source code output Hello.py
  8. 8. Python featuresno compiling or linking rapid development cycleno type declarations simpler, shorter, more flexibleautomatic memory management garbage collectionhigh-level data types and fast developmentoperationsobject-oriented programming code structuring and reuse, C++embedding and extending in C mixed language systemsclasses, modules, exceptions "programming-in-the-large" supportdynamic loading of C modules simplified extensions, smaller binariesdynamic reloading of C modules programs can be modified without stopping
  9. 9. Python featuresuniversal "first-class" object model fewer restrictions and rulesrun-time program construction handles unforeseen needs, end- user codinginteractive, dynamic nature incremental development and testingaccess to interpreter information metaprogramming, introspective objectswide portability cross-platform programming without portscompilation to portable byte-code execution speed, protecting source codebuilt-in interfaces to external system tools, GUIs, persistence,services databases, etc.
  10. 10. Variables Variables are names for values Created by use: no declaration necessary>>> planet = Pluto variable value>>> print planetPluto planet Pluto>>> moon = Charon>>> p = planet moon Charon>>> print pPluto p>>>
  11. 11. A variable is just a name Does not have a type>>> planet = Pluto variable value>>> planet = 9 planet Pluto>>> 9 Values are garbage collected If nothing refers to data any longer, it can be recycled
  12. 12.  Expression Print : Produces text output on the consoleSyntax: print "Message" print Expression Prints the given text message or expression value on the console, and moves the cursor down to the next line. print Item1, Item2, ..., ItemN Prints several messages and/or expressions on the same line.Examples: print "Hello, world!" age = 45 print "You have", 65 - age, "years until retirement" Output: Hello, world! You have 20 years until retirement
  13. 13.  Input• input : Reads a number from user input. – You can assign (store) the result of input into a variable. – Example: age = input("How old are you? ") print "Your age is", age print "You have", 65 - age, "years until retirement“ Output: How old are you? 53 Your age is 53 You have 12 years until retirement
  14. 14. Uses of Python• shell tools – system admin tools, command line programs• extension-language work• rapid prototyping and development• language-based modules – instead of special-purpose parsers• graphical user interfaces• database access• distributed programming• Internet scripting
  15. 15. What not to use Python (and kin) for• most scripting languages share these• not as efficient as C – but sometimes better built-in algorithms (e.g., hashing and sorting)• delayed error notification• lack of profiling tools
  16. 16. Thank you
  17. 17. • If this presentation helped you, please visit our page facebook.com/baabtra and like it. Thanks in advance.• www.baabtra.com | www.massbaab.com |ww w.baabte.com
  18. 18. Contact Us