Python Learning notes (i)

Source: Internet
Author: User

About Python

Python is a high-level scripting language that combines explanatory, interactive, and object-oriented

    • Python is an interpreted language: This means that there is no compilation in the development process. Similar to the PHP and Perl languages.

    • Python is an interactive language: This means that you can execute your program in a Python prompt directly interacting with the execution.

    • Python is an object-oriented language: This means that Python supports object-oriented styles or code encapsulation in object programming techniques.

    • Python is the language of beginners: Python is a great language for novice programmers, and it supports a wide range of application development, from simple word processing to WWW browser to gaming.

Python output

Python 2 print "Hello, world!" ;

Python3 Print("Hello, world!" );

Python. py file Start

#!/usr/bin/python
#-*-coding:utf-8-*-

Line and indent

Python's most distinctive feature is the use of indentation to represent blocks of code, without the need for curly braces ({}).

The number of spaces indented is mutable, but the statement of the same block must contain the same number of indent spaces

Python3 List

list1 = [< Span class= "hl-quotes" > ' google runoob" 19972000

< Span class= "Hl-code" > list data items do not need to have the same type

< Span class= "Hl-code" > access list elements List1[ 0 list2[1:5 ]   @1, starting from list[1] to 5 is the Fifth Element

< Span class= "Hl-code" > python3
/span>

< Span class= "Hl-code" > python a tuple similar to a list, except that elements of tuples cannot be modified

tup1 = (' Google ', ' Runoob ', 1997, + );

Python Learning Note (i)

Related Article

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.