The list is represented by an ordered set of [] elements that can be added and removed at any time. The len () function can get the number of list elements, the list is a mutable ordered table, so you can append the element to the end of the list,
Suppose you have the following code: for in range: if i = = 5 :print'found it! i =%s ' % ielse: print'notfound it ... 'The result you expect is that when found 5 o'clock print out:Found it! i = 5The results are actually printed
The following code can be implemented after logging on to the network device through the show CDP nei command to view the neighbor device, and then use stitching to add the description, and then write into the corresponding network device interface.#
First, Python the data type in
integers, such as 1-100
A long integer, which is a large integer, with a long integer in Python 2; Python 3.
Floating-point numbers such as 1.23, 3E-2
Boolean type False True
Second, Number
One, what is closures:1, function within the definition function.2. A reference to the function when the outer function returns.3. The inner function uses the local variable of the outer function (at least one).1 def Outfunc (): 2 for in range
In fact, the other people on the Internet writing are very good, I also look at them. Office use of 2.7. Notebook 3.6. Found no file class, awkward with open (R " c:\users\hbx\documents\ new folder \ Baixi.txt ", " r " ) as F: print (F.read (
A nested function is to nest one or more functions in a function.#-*-Coding:utf-8-*-__author__ = "MuT6 Sch01ar" def first (): print ("in the first") def Second (): print ("in t He second ") def third (): print (" in
Dynamic parameters: One, *args:args is Ganso, it contains all the positional parameters.1, the first form parameter contains only *args.def func (*args): Print(*args,type (args)) func (1,2,3,4,5)only *args are included in formal parameters2,
6.1 function return values, anonymous functions lambda, filter functions, map functions, reduce functions, lambdareduce
Function return value:
Once the function is executedreturnThe function ends and returns the value after return. If return
The road to wudao-the three major days of the refining stage
Set (variable ):
Unique, unordered, set () is converted into a set, removing duplicates.
Setx = set ([,]), sety = set ))
Add: setx. add (), add an element to it, setx. update ([2, 4, 3]
Django model, djangomodel1. Create a table
Mappings between ORM and databases in django:
Table name Class NameField attributeTable Record class instance object
Creating a table is a process of creating a class:
class Book(models.Model):
Python --- process and thread, python --- process threadProcesses and threads what are threads and processes
Thread: The minimum unit that the operating system can schedule operations. It is included in the process and is the actual operating unit
5. Comments, branch structure, loop structure, pseudo "select structure", and branch
Note:
Python uses # As the line annotator and three quotation marks as the multi-line annotator
Branch Structure: if-else:
A = int (input ("your score is:")
Python built-in modules
# Continuous update
# Import a built-in module, for example, import abc, to import the abc module. Of course, the module can also be written by itself, which is equivalent to a class, this is because the environment is idle
Python linear regression analysis, python linear practiceI. Linear Regression Theory
1) Basic concepts of Linear Regression
Linear regression is a supervised learning algorithm. It describes the linear correlation between the independent variables
Python-day1,
Content of this section:
I. Python introduces python as an interpreted language. It is concise and powerful. Why is it concise? Why is it powerful? I don't know why. I just want to write python.
Ii. Select python 2.1
Installing
In python, xlrd is used to read excel and xlwt is used to write the excel instance code. xlrdxlwt
In the process of data analysis and operation, there are a lot of cases that need to be provided to others. There are many ways to provide, most often
Tianchi new talent competition-Tianchi new talent competition o2o coupon usage prediction (1), Tianchi o2o
The first time I participated in the Tianchi new talent competition, I wanted to examine my achievements in machine learning and
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