Tuple tuplesTuples cannot be changed once they are createdRepresentation method:name1= ("Luo", "gu", "Hu")Within a tuple, it can be a string, a number, or a mixed typeFor a tuple operation, the following functions are available:#1, CMP (name1,name2):
# definition# module: Used to logically organize Python code (variables, functions, classes, logic: Implementing a function), essentially# is the Python file at the end of the. PY (file name: test.py, corresponding module name: TEST)# package: Used
Python Variable Naming conventions1. To have descriptive2. Variable names can only be: numbers, letters, can not be spaces or special characters, such as: (#?. ,¥$*~!&) etc.3. Cannot be Chinese4. Cannot start with a number5. Reserved characters
List
API
function
equivalent Operation
List.append (x)
Add an element to the end
A[len (a):] = [x]
List.extend (L)
Add a list of elements to another list
A[len (a):] = L
Python common function functions summary 1. write string to file in lineImportsys, OS, time, JSONdefSavecontext (filename,*name): Format='^'Context=Name[0] forIinchName[1:]: Context= context + format +Str (i) Context= str (context). replace ('(','(')
First, explainProcess-oriented: The core is the process of two words, the process is to solve the problem, based on the process to design the program is like in the design, pipeline programming ideas, in the design process, the need to design the
Sys.version get version information for Python interpreter>>> sys.version ' 2.7.12 (default, Dec 4, 14:50:18) \N[GCC 5.4.0 20160609] 'Sys.platform returns the operating system platform name>>> sys.platform ' linux2 'Sys.getrecursionlimit ()
# _*_ Coding:utf-8 _*_# There is a difference between the 2.* version and the 3.* version # content = Raw_input ("Please enter content:") # print (type) #str # print (content) Content = input ("Please enter:") print (content) #python2 (int), Python3
#use of while#To be aware of the loops, consider the end of the loop.#There are 2 ways to consider the end of the loop:#1. Consider changing the condition of while in the loop body#2. Jump out of loop through break statement in the loop
Python Beginner Basics Learn a python download and install
: https://www.python.org/ , select the latest version to download
Wait a moment and the installation is complete.Simple statement
From idle start Python:idle is a Python
Execute Yum list, prompt/usr/bin/yum errorI am directly on the basis of the Python2.7 and install the Python3.6, and then Ln-s/usr/local/bin/python3/usr/bin/python, and then directly execute Python will default to use the Python3.6 versionBut
Outline: The basic idea of object-orientedClass-to-object relationshipsStructure and members of a classMagic functions in Python Complete design and instantiation of classes by functional requirementsAll objectsBIFs:Type () return data type ID ()
#计算人体体脂率 # Input Part # height Personheight= Input ("Please enter your height (m):") Personheight=float(personheight) #体重personWeight= Input ("Please enter your weight (Kg):") Personweight=float(personweight) #年龄personAge= Input ("Please enter your
There are three ways to assign a Python variable;1. Direct assignment: Age = 282. Multiple variable assignment age, sex = 1 #每个变量都必须要有个对应的值3. Special form Assignment A = b = 28Note that variables must be assigned before they are used, which differs
Python graphical interface development and programming: wxPython (simple introduction), development and programming wxpython
Python provides a library for multiple graphical development interfaces. Several Common Python GUI Libraries are as follows:
4. File Operations and file operationsComputer systems include hardware, operating systems, and application hardware. The purpose is to run commands issued by software. The Hardware includes CPU, memory, and hard disk. Most CPUs have two modes:
The connection failure log for killing tornado in python, pythontornado
Tornado is really comfortable, and many things are done for you.
But there is also something unsatisfactory-For me, it is intolerable to automatically print out uncontrolled
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