__getattr__ method
Intercept the operation of the dot number. When an undefined property name and instance is performed, the method is called with the property name as a string. If the inheritance tree can find the property, this method is not
The longest common subsequence is a very basic algorithm, but recently used to take to learn, there are a lot of Java version of the Web, and indeed write is very good, thinking is very good, roughly divided into three kinds:
1. The thought based on
Recently wrote a blog, suddenly want to know their blog reading trends are how, helpless csdn does not provide this function. It was supposed to be an occasional manual check, log into the Excel table and then after a while to know the approximate,
617. Merge Two Binary treesDescription hints submissions discuss Solution one
Given Two binary trees and imagine that's put one of them to cover the other, some nodes of the two trees are Overl Apped while the others are is not.
You are need to the
The body is the capital of revolution, health, we have more energy to do what we want to do, the pursuit of the goddess, the pursuit of dreams. However, the programmer is a bitter career, most of the time on the computer, I now cervical vertebra is
Today I read the second chapter of Python's core programming, which tells about the communication of the Python socket module, with the following notes:Sockets: 1, Af_unix af_inet socket Address: Host-port to connection-oriented sockets: A
#-*-coding:utf-8-*-
' Created on
April 29, 2017
@author: Administrator ' '
# if
food = raw_ Input (' Your name is ')
if food = = ' Jack ': Age
= ' kt '
print age
elif food = ' hack ': Age
= ' kts '
p Rint Age
Else:
print '
Where . + represents a match of any character 1 to an infinite number of times \s represents matching spaces, tabs, page breaks, and so on, equivalent to [\f\n\r\t\v]
import Re target_pattern = [(lambda? x (P E. x)) "," (Lambda? x (and (P E. x)
One list type
One of the data types built into Python is the list: lists. A list is an ordered set of elements that you can add and delete at any time .
For example, if you list the names of all the students in your class, you can use a list to say:
The use of Map,reduce,filter in 1,python
>>> a=[1,2,3,5]
>>> map (lambda x:x+x,a)
[2, 4, 6, ten]
>>> map (lambda x:2*x,a)
[2, 4, 6,]
>>> reduce (lambda x,y:x*y,a)
>>> filter (lambda x:x%2,a)
[1, 3, 5]
The use of Map,reduce,filter in
#!/usr/bin/python
#coding: utf-8
d = {' Adam ': $, ' Lisa ': ", ' Bart ':", "Paul": "The", "
the key of the iteration dict" for
x i n D.keys ():
print x
# can also be used in this way to iterate
for x in D.iterkeys ():
The value of the dict
Description:
You are are given two sorted list of numbers (ascending order). The lists themselves are comma delimited and the two lists, are semicolon. Print out the intersection of the two sets. Input Sample:
File containing two lists of ascending
Come up early in the company to write a blog, I was also drunk
This blog is mainly about Python's built-in functions:
Next, we'll explain 4 built-in functions:
Apply ():
#!-*-coding:utf-8-*-
' Created on
2015-4-7
@author: huangpeng03
Apply can
1. Installation Support Section:
Enter the following command directly inside the terminal, which will install the required dependencies on Sklearn, including scipy, numpy some mainstream dependencies.
sudo apt-get install build-essential
# taobao # introduced from selenium to Webdriver from selenium import webdriver import Time # Declares a class type TaoBao (object): # when initialized, pass the quotient to query Product Keyword def __init__ (self,keyword): Self.keyword = Keyword
1. Higher-order functions
Map/reduce:Map: Accept two parameter map (f, list), perform F function operations on each element in the list, generate a Map object, call with loop or list type conversion.
def f (x): Return
x*x
a = map (f, [1, 2, 3,
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