Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

01 Python Basics

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

Python Introduction and

Facts
Meet Creator of Python: Guido van Rossum

22-10-2018 2
What is Python?
• An interpreted, Multi Purpose, object-oriented programming language
similar to PERL
• Said to be relatively easy to learn.
• Extremely attractive in the field of Rapid Application Development.
• Python 1.0 was released in 1994.
• Supports the use of modules and packages

22-10-2018 3
Why do people use Python?
• Readable and Maintainable Code
• Multiple Programming Paradigms
• Object oriented
• Structured programming
• Dynamic type system
• Automatic Memory Management
• Compatible with Major Platforms and Systems
• Robust Standard Library
• Many Open Source Frameworks and Tools
• Django, Flask, Pyramid, Bottle and Cherrypy
• PyQT, PyJs, PyGUI, Kivy, PyGTK and WxPython

4
Quotes about Python
• Python is used successfully in thousands of real-world business applications
around the world, including many large and mission critical systems.
• Here are some quotes from happy Python users:
• YouTube.com
• "Python is fast enough for our site and allows us to produce maintainable features in record
times, with a minimum of developers," said Cuong Do, Software Architect, YouTube.com.
• Google
• "Python has been an important part of Google since the beginning, and remains so as the system
grows and evolves. Today dozens of Google engineers use Python, and we're looking for more
people with skills in this language." said Peter Norvig, director of search quality at Google, Inc.

• https://www.brainyquote.com/topics/python-quotes
• https://avilpage.com/2014/12/14-great-quotes-about-python.html

5
Python History

6
ABC
• The history of Python starts with ABC.

• ABC is a general-purpose programming language which had been


developed at the CWI (Centrum Wiskunde & Informatica).

• The greatest achievement of ABC was to influence the design of


Python.

23-Sep-2018 Python Basics - History and Facts 7


What Guido van Rossum in an Interview
• In an interview with Bill Venners (January 2003), Guido van Rossum
said:
• I remembered all my experience and some of my frustration with ABC.
• I decided to try to design a simple scripting language that possessed some of
ABC's better properties, but without its problems.
• So I started typing.
• I created a simple virtual machine, a simple parser, and a simple runtime.
• I made my own version of the various ABC parts that I liked.
• I created a basic syntax, used indentation for statement grouping instead of
curly braces or begin-end blocks, and developed a small number of powerful
data types: a hash table ( or dictionary, as we call it), a list, strings, and
numbers.

23-Sep-2018 Python Basics - History and Facts 8


Python Facts and History
• Python interpreters are available for many operating systems.

• Python was conceived in the late 1980s and

• Its implementation began in December 1989 by Guido van Rossum at


Centrum Wiskunde & Informatica (CWI)

23-Sep-2018 Python Basics - History and Facts 9


Python 2.7 End of Life
• Python 2.7's end-of-life date was initially set at 2015, then postponed to 2020
out of concern that a large body of existing code could not easily be forward-
ported to Python 3

• Rather than having all of its functionality built into its core, Python was
designed to be highly extensible.

22-10-2018 10
What’s Python good for?
• Web Development
• Python has a large selection of pre-built libraries for just about anything.
• Python code takes less time to write due to its simple and clean syntax.
• Python has a built-in framework for unit tests.
• Internet of Things
• Python’s close relation to scientific computing has allowed it to gain ground in IoT
development
• Python is the language of choice for the Raspberry Pi.
• Python offers tools that streamline the IoT development process, such as webrepl
• Since Python is an interpreted language, you can easily test your solution without
compiling the code or flashing the device
• AWS offers a Python SDK for AWS IoT.

11
What’s Python good for
• Machine Learning
• Data Analytics
• Network Automation

12
What’s Python not good for?
• Speed
• Mobile Development
• Large Memory Consumption

13
The features list
• Easy to Learn and Use
• Expressive Language: More understandable and readable.
• Interpreted Language: Makes debugging easy and suitable for beginners
• Cross-platform Language
• Free and Open Source
• Object-Oriented Language
• Large Standard Library

14
Python Portability
• Python has excellent portability.
• It runs on many Unix variants, on the Mac, and on Windows 2000 and later.
• Can write one script and run it seemlessly on Windows, Linux and MacOSX.

15
Using the Python Interpreter
• Invoking the Interpreter
• Installed as /usr/local/bin/python3.x
• python3.8
• python
• To exit:
• Typing Control-D on Unix
• Type Control-Z on Windows
• quit()
• Run python script:
• python demo.py

16
Comments in Python
• # This is a comment

• print("This will run.") # This won't run

• Multiline comments can’t be done in Python

• “Another thing you can do is use multiline


• strings by wrapping your comment inside a
• set of triple quotes”

17
Python Variable Types with Examples

Object type Example literals/creation

Numbers 1234, 3.1415, 999L, 3+4j, Decimal

Strings 'spam', "guido's"

Lists [1, [2, 'three'], 4]

Dictionaries {'food': 'spam', 'taste': 'yum'}

Tuples (1,'spam', 4, 'U')

Files myfile = open('eggs', 'r')

Other types Sets, types, None, Booleans

18
Thanks
22-10-2018 19

You might also like