First, open the Sublimetext, find the tools--> compiler system--> The new compilation system in the menu bar
Two. Enter the following configuration in the new configuration file
{
"cmd": ["**********" "U", "$file"],
"File_regex":
How many people walk but trapped in situ, how many people live but like dead, how many people love but seems to separate, how many people smile but full of tears ~
Most of the 2 libraries are used to convert time formats to each other: times and
One, tuple is also a class, is immutable list type, can not be deleted.
Create:
Tup1 = (' Physics ', ' Chemistry ', 1997, 2000);Tup2 = (1, 2, 3, 4, 5);Tup3 = "A", "B", "C", "D";
visit: (same as List) Tup1[1:5];
modification: Can not be modified,
Use of lists and tuples in Python
List lists are a series of variables that cannot be changed.
Define a list = [A,b,c,d,] #定义一个列表使用 ' [] ', or whether list (' ABCD ') is very much like a constructor, the list does not restrict the type of the
python download installation Environment build and initialization program implementation1, download Python, into the official website https://www.python.org/downloads/
2, select window, enter the following page:
3, to see their own computer
Prime numbers (prime number) are also called prime numbers, with an infinite number. A prime number is defined as a number of natural numbers greater than 1, with the exception of 1 and itself no longer having other factors, such as prime numbers
1
Go from: Liaoche python tutorial
* * This program uses the filter filter to screen prime numbers, and surprisingly the sequence used for filtering is an inert sequence * *
#!/usr/bin/env Python3
#-*-coding:utf-8-*-
"" "
Created on Sat Feb 4 21:01
#-*-Coding:utf-8-*-
"" "
enter 3 unit , and sort them" "
L = [] for
x in range (3):
l.append (int (raw_input ("Enter one unit data:\n"
)) L.sort ()
l.sort (reverse=true)
print L
# Try with bubble sort
bubblelist = [ 12,123,45,78,43,21,99,7
Type of judgment
In Python, we can use type to judge types
#我们想看一个对象的的类型可以这样
Class A:
pass
a = a ()
type (a) = = a #True
#type (obj) returns the type that created a
Creating objects
#这个简单, because type returns the type of the object, we can
The common data structures in Python can be collectively referred to as Containers (container). sequences (such as lists and tuples), mappings (such as dictionaries), and collections (set) are the three main types of containers. First, sequence
Trees (English: Tree) are composed of N (n>=1) finite nodes to form a set of hierarchical relationships. It's called a "tree" because it looks like an upside down tree, which means it's rooted and the leaves are facing down.Often implemented using
Linux Ubuntu 12.04 has its own Python2.7.3 version, and if you need to install a different version of the general operation is:
It's best to check for dependencies first
sudo apt-get build-dep python
(If you subsequently install Django, remember to
The list is a common data type in Python that is built into Python and inherits from object. Next, a comprehensive introduction to the list of common methods and their own implementation of the class list function of the class
Create a list
Create
The difference and usage of os.mkdir () and Os.makedirs () in Python
Write code today encountered the creation of a directory, the first use of Os.mkdir (path) has been an error, in other places to look for a long time, always thought there is no
1.URLError
The reasons for the Urlerror:
(1) No connection to the network, that is, the computer can not access
(2) Not connected to a specific server
(3) server does not exist
Import urllib.request
import urllib.error from
urllib.request import
Topic description
Enter two binary tree a,b to determine whether B is a sub structure. (PS: We agreed that an empty tree is not a substructure of any tree)
Topic link
#-*-Coding:utf-8-*-# class TreeNode: # def __init__ (self, x): # self.val = x #
Topic Description
Input two monotonically increasing list, output two list after the synthesis of list, of course, we need to synthesize the list to meet the monotonous rules.
Idea: Initialize two list headers, one of which is used to record the
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