2 Introduction to Python

Source: Internet
Author: User
Tags floor division

1.Python Introduction:Uncle Turtle

The founder of Python is Guido van Rossum (Guido van Rossum). during the 1989 Christmas season ,Guido began writing the Python language compiler. The name Python, from Guido's beloved TV show Monty Python's Flying Circus.

He hoped that the new language, called Python, would fit his ideals: create a language that is all-powerful, easy to learn, easy to use, and extensible, between C and Shell.

The history of 2.Python

In 1989, Guido began writing the Python language compiler.

1991, the first Python compiler was born. It is implemented in C language and can call the C language library file. From birth, Python already has: classes, functions, exception handling, core data types including tables and dictionaries, and module-based expansion systems.

Granddaddy of Python Web frameworks, Zope 1 is released in 1999

Python 1.0-january 1994 adds lambda, map, filter and reduce.

Python 2.0-october 16, 2000, added a memory recovery mechanism that forms the basis of the Python language framework Now

Python 2.4-november 30, 2004, the same year now the most popular web framework Django was born

Python 2.5-september 19, 2006

Python 2.6-october 1, 2008

Python 3.0-december 3, 2008 (here to explain why the 08 3.0, 2010 instead of the introduction of 2.7?) is because 3.0 is not compatible with 2.0, causing everyone to refuse to upgrade 3.0, but the official can only launch 2.7 transition version)

Python 2.7-july 3, 2010

In November, it is announced that Python 2.7 would is supported until 2020, and reaffirmed that there would is no 2. 8 release as users were expected to move to Python 3.4+ as soon as possible

Python 3.1-june 27, 2009

Python 3.2-february 20, 2011

Python 3.3-september 29, 2012

Python 3.4-march 16, 2014

Python 3.5-september 13, 2015

Python 3.6-2016-12-23 release version python3.6.0

What kinds of 3.Python are there?

CPython

When we downloaded and installed Python 2.7 from the official Python website, we immediately got an official version of the interpreter: CPython. This interpreter was developed in C language, so called CPython. Running Python at the command line is the start of the CPython interpreter.

The CPython is the most widely used Python interpreter. All the code for the tutorial is also executed under CPython.

PyPy

PyPy is another Python interpreter whose goal is to perform speed. PyPy uses JIT technology to dynamically compile Python code (note that it is not interpreted), so it can significantly improve the execution speed of Python code.

Most python code can run under PyPy, but PyPy and CPython are somewhat different, which results in the same Python code being executed under both interpreters. If your code is to be executed under PyPy, you need to understand the differences between PyPy and CPython.

4.Python 2 or Python 3?

In Summary:python 2.x are legacy, Python 3.x is the present and future of the language

Python3.0was releasedinch  -. The final2. x version2.7Release came out inchmid- ., with a statement ofextended support for  ThisEnd-of-life release. The2. x Branch would see noNewMajor releases after.3. x isunder active development and have already seen over five years of stable releases, including version3.3 inch  -,3.4 inch  the, and3.5 inch  -. This means, the recent standard library improvements, forexample, is onlyavailable bydefault inchPython3. X.guido van Rossum (the original creator of the Python language) decided to clean up python2. x properly, with less regard forBackwards compatibility than isThe Case  for NewReleasesinchThe2. x range. The most drastic improvement isThe better Unicode support (with all text strings being Unicode bydefault) asWell asSaner bytes/Unicode separation. Besides, several aspects of the core language (such asPrint and Exec being statements, integersusingFloor division) has been adjusted to be easier forNewcomers to learn and to is more consistent with the rest of the language, and old cruft have been removed ( forexample, all classes is nowNew-style,"Range ()"Returns a memory efficient iterable, not a list as inch 2. x).

5. First Python program

Learn 2 ways to execute Python code

1. File Execution
    1. Create a file with notepad++ and enter the following code
    2. print("Hello World!")print("Python好简单呀,我要学好挣大钱!")
    3. Save As helloworld.py, and be careful to emphasize the role of the. PY suffix name
    4. Go to the cmd command line, execute the Python helloworld.py, and look at the results (note that the reason to interpret the file name before Python is to give the code to the Python interpreter to interpret the execution)
c:\users\administrator\desktop>python Helloworld.pyhello World learns to earn money

# the suffix name has no effect on Python c:\users\administrator\desktop>python Helloworldhello World learns to earn money

2. Interactive execution: Debug

Demo in python interactive, output Hello world!

To emphasize that Python interactivity is primarily used for debugging code

C:\users\administrator\desktop>Pythonpython3.5.4 (v3.5.4:3f56838, 8, 02:17:05) [MSC v.1900 64bit (AMD64)] on Win32type" Help","Copyright","credits" or "License"  forMore information.>>>>>>Print("Hello World") Hello World>>>

6. Hello world Proficient in all languages

C++

# include <iostream> int main (void) {  std::cout<<"HelloWorld";}

C

# include <stdio.h> int main (void) {printf ("\nhello world! " ); return 0;}

Java

class helloworld{  // program entry public  static void Main (String args[]) {    // Output information    to console System.out.println ("Hello world! " );  }}

Php

<php               "Hello world! " ;  ? >

Ruby

" Hello World. "

GO

Package Main Import " FMT " Func Main () {    fmt. Printf ("Hello world!\n God Bless you! " );}

2 Introduction to Python

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.