1, the general definition of statement characteristics: they change things.2. You can use variables to refer to functions.3, Nan:not a number (non-numeric)4. str function: Converts a value into a reasonable form of a string, the Repr function
official Python document: https://www.python.org/dev/peps/pep-0008/Code style:
Use 4 empty Glyd to indicate indentation, preferably not using tab, and not to mix the two
Wrap at least one line between functions
Wrapping at least two
Tag:python Optimization object #-*-Coding:utf-8-*-## def displaynumtype (num): # print num, ' is ', # if type (num) = = Type (0): # print ' an Integer ' # elif type (num) = = Type (0L): # print ' A long ' # elif type (num) = = Type (0.0):
In Python, a variable is marked or pointed to a value. When a variable is encountered, Python replaces it with a pointer to a value.>>> cost=2.99>>>. 1*cost0.29900000000000004Variable naming rules:
The length of the variable name is
#-*-Coding:utf-8-*-__author__ = ' xy ' #切片 (slice) Extension Usage # # # # of slices with a step index to expand # Slice[1:2:3] where the 3rd position represents the step size, the default is # Simple str flip: s = ' ABCDE ' Print s[::-1]# >>> '
This function is to implement a tuple list iteration from multiple sequences, that is, to get an item from each sequence, and then to generate a tuple of all the items, and then return those tuple-generated lists. If there are multiple sequences,
Originally want to share some knowledge, but found, write write, feel share some experience, perhaps less let everyone go some detours, simply put the title of a change.I do not teach you what, I am not qualified, I am also stones, I just in the
System Programming: Provides API (Application programming Interface application programming Interface), can facilitate system maintenance and management, Linux under one of the iconic languages, is the ideal programming tool for many system
Libxml/xmlversion.h:no such file or directory
sudo Install Libxml2-dev Libxslt1-dev
Environmenterror:mysql_config not found
sudo Install Libmysqlclient-dev
Numpy.distutils.system_info. Notfounderror:no Lapack/blas
Abnormal
Exception handling
Catching exceptions
Throw exception
Custom exceptions
Some of the common exceptions
Exception handling catches exceptions
try/exceptSimilar to catching
Define a web crawlerWeb Spider, also known as Spider, Network robot, also known as Web Chaser. According to certain rules, the program or script of the dimension network information. Other infrequently used names are ants, self-indexing, simulation
Learning Python was meant to be fun, but it was found that the language was as simple as people's, so that the block was close to human language, which brought great benefits to the developers themselves.Anyway is learning to play, I will start from
Processes and ThreadsIn multitasking, each task has its own process, and a task has many subtasks that open threads in the process to perform these subtasks. In general, you can run the base unit of a separate dispatch and allocation as a thread,
Find the nth element in the sequence (implemented by the partition function) and the partition Function
Partition is a segmentation algorithm used to divide a sequence a [n] into three parts: a [n] is greater than the part of an element x, equal to
Common methods in the time module of Python, pythontime
In the process of application development, it is inevitable to deal with date and time processing. For example, record the execution time of a complex algorithm and the delay of packets in
Interaction between Python Web. py and AJAX
If you haven't written a Blog for a long time, you may be lazy or feel that you have written something quite low before, and you are not too eager to write a Blog.
The practical training has already
Python MD5 Encryption
The following describes how to use the Python built-in hash library to encrypt strings using MD5:
First, import the modules required for MD5 encryption:
Import hashlib
Then create an md5 object:
M = hashlib. md5 ()
Python local and global namespace usage instance, python global namespace
This example describes the usage of local and global namespaces in Python. Share it with you for your reference. The details are as follows:
X = 1def fun (a): B = 3 x = 4
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