#/usr/bin/python#coding =utf-8# @Time: 2017/10/24 9:09# @Auther: Liuzhenchuan# @File: Parameters of the function. PY#比较参数x, the size of ydef Fun (x, y): if x>y: print x elif x print y Fun (6,7) >>> 7Fun (8,4) >>> 8# #函数应用异常处理def Fun ():
Introduction of Urlparse ModuleThe Urlparse module mainly splits the URL into 6 parts and returns the tuple. And you can make the split part a URL again. The main functions are Urljoin, Urlsplit, Urlunsplit, Urlparse and so on.Second, Urljoin
Python data structures are mainly: list lists,1, List(1) Basic methodsPrint("lsit List of PYTHON data Structures") A=[66.34,666,666,1,25.6]Print("list.count (x) returns the number of occurrences of x in the list:", A.count (666), A.count (66.34),
# Create date:2017.10.31 Tuesday# Author:eric Zhao#-*-Coding:utf-8-*-‘‘‘Writing the Login interfaceEnter User name passwordShow welcome message after successful authenticationThree-time error after locking‘‘‘Login_user = input (' Please input user
Time module : Timestamp, time string, time object, and how to convertRandom module : Randomly decimal, Integer, interval, random list elements, scatter listOS module : An interface that interacts with the operating system, os.path the path to the
Django Deployment:1. Rent a cloud Server2. Buy a serverRent: Public network ip,111.13.101.208Leased domain: www.pythonav.com 111.13.101.2083. Writing code4. Copy the code to the server [Python,django,pymysql,sqllite]5.settings.pyallowed_hosts = ['
1. Sort a list of numbers from small to large, then write to the file, then read the contents of the file from the file, and then reverse-order it in the next line appended to the file.import codecsl1=[22,32,5,88,43,20,18,99,201,100,302]l2=[]print '
Since Python does not have a way to modify the contents of a file, it has written two functions to modify the contents of the file.ImportOSdefChange_file (address,line,content):#Modify a file to specify a lineF=open (Address,"R", encoding="Utf-8") F2
1. Create a Web application, the Django Web Framework (HTTPS://DOCS.DJANGOPROJECT.COM/EN/1.4/INTRO/TUTORIAL01)2. SciPy (http://www.scipy.org), if you are interested in science, mathematics, engineering, can look. If you want to combine scipy to
Python variable,
Python variable
It is very easy to define variables in python, for example, the following code:
Name = "admin"; print (name );
The above is to define a basic variable. Here we will talk about some other things about the variable.
First week of Python learning, first week of python
I. My first program
print("Hello word!")
Therefore, python is a very concise language. Unlike c, c ++, and so on, you have to call a bunch of libraries to write a simple program. In addition,
Python input,
Python Input
The input after python3 is different from that after python2.7. The input function is input ()
Username = input ("username"); password = input ("password"); print ("username", username); print ("password", password
Shorthand Boolean Value
In python. Boolean values include true and False. True equals to true, and False equals to error. Note that uppercase and lowercase letters are strictly required in python. The first letter of true and False must be
Traverse dictionary and calendar dictionary
1. Store dictionaries in dictionaries
Cities = {'Guangdong province ':{'Guangzhou City ': ['China', '123', 'yangcheng'],'Shenzhen City ': ['China', '123', 'dynamic City'],'Zhuhai City ': ['China', '123',
K-Nearest Neighbor AlgorithmOverview
This algorithm classifies data by measuring the distance between different feature values.
Advantage: high accuracy, no sensitivity to abnormal values, no data input assumptions.
Disadvantage: The computing
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