collection (set)Collection, save a lot of data, can not repeat features: unordered, non-repeatable, content can be hashed, itself is not hash k = fRozenset (collection): It's going to be a hash.Increase:S.add (content) s.update ("content"): Iterative additionsDelete:S.pop (): Randomly deletes one and returns the deletion of that content s.remove (' specified element '): Delete the specified element, if not present will error S.clear (): Empty collection, if print out empty collection will show s
longer locally created. ? is the direct cause of the global aA=28Print (a)Func ()Print (a)# for variable data types you can go directly into the. But you can't change the address. Say it. Cannot assign a valueLST = ["Twist Vine", "Carina Lau", "James"]def func ():Lst.append ("? and") # can be accessed directly into the variable data type. But you can't change the address. Say it. Cannot assign a valuePrint (LST)Func ()Print (LST)2.nonlocal table? In the local field, adjust? Variable in the clas
corresponding to the same value, forming a dictionaryinfo='Alex's1={}v2=s1.fromkeys (info,222)print (v2) {'a'l'e ' ' x ': 222}4.5 get, returns value according to Key, if none is returned, the none can be modified info={'Alex': 123, 'a':'nishishei' ,'v': 555}#info= ' Alex 'v2= Info.get (567,222)print(v2)------222Because there is no key567, so return parameter, 2224.6 Pop (key, return default value)If there is no key, the default value is returnedIf there is, then delete and get4.7 Popitem ()R
, you can use pass to skip, cannot write anything, such as:If a==a: passesle: print (' Hello World ')5. Basic data Type 5.1 strings all enclosed in quotation marks are characters, collectively referred to as strings, ', ', ', ' and ', ' only these three are strings, and starting with a quotation mark must end with the same quotation mark. Addition of strings:A= ' Alex ' c= ' sb ' n=a+cn= ' ALEXSB 'Multiplication of stringsB=a*10b= ' Alexalexalex ... ' 10 total5.2 Numbers without quotation
, logging module1. Control Log Level2. Control log Format3. The target of the control input is the fileLogging.basicconfig (filename= ' Access.log ',format= '% (asctime) s-% (name) s-% (LevelName) s-% (module) s:% (message) s ',datefmt= '%y-%m-%d%h:%m:%s%p ',LEVEL=10,)4. Level of log: 1.logging.debug () 2.logging.info () 3.logging.warning () 4.logging.error () 5.logging.critical ()Advantages: 1. Ability to record diaries in both terminals and files 2. Ability to modify string encoding5.logger ob
{Font-size:20px; color:red; } /* Select the last element */Div ul Li:last-child{Font-size:20px; Color:yellow; } /* Select the currently specified element value starting at 1 */Div ul Li:nth-child (3) {font-size:30px; Color:purple; } /*n means check all, this must be N, from 0 to 0 is not selected */Div ul Li:nth-Child (n) {font-size:40px; color:red; } /* even * *Div ul Li:nth-Child (2n) {font-size:50px; Color:
competition is not very fierce, but also a relatively good job position, pay is quite good. First of all to see the North Canton pay.How are you happy to see this salary? Now let me share with you all the information I have compiled.Python BeginnerPython IntermediatePython AdvancedInformation more than these I do not need each of these information you, focus on the forwarding of private messages to me, you can obtain the information, I hope that my information can help you. Well, I'm going to s
19. Kill the host. The following information on the host revenue, as required, to complete the appropriate operation:(1) Calculate the average return value of the anchorsum = 0 for in zhubo.values (): + =Iprint(round (Sum/len ( Zhubo)))(2) to kill the host with less than average income dic1={} # Create an empty dictionary to store people less than the average for i,j in zhubo.items (): # loop anchor dictionary if j# below the mean condition dic1[i]=j # People below the mean a
24. File A1.txt content (note that the spaces in each line are not the same, you need to handle the space)Number of department number average age remark1 Python 30 26 single Dog2 Linux 26 30 no objects3 Operations Department 20 24 more girlsThrough the code, build it into this type of data:Li = []ImportRewith Open ('T4','R', encoding='Utf-8') as F:first= Re.sub (r"\s{2,}"," ", F.readline (). Strip ()) first= First.split (' ') #print (first) forIinchf.readlines (): DiC={} i= Re.sub (r"\s{2
Tag: Col key value to RET UNC data type call int return python7. This function receives only one parameter and this parameter must be a list data type, and the functionality that is done is to return a dictionary to the caller, the dictionary's key value pair for this list index and the corresponding element. For example, the incoming list is: [11,22,33] Returns a dictionary of {0:11,1:22,2:33}.L2 = [11,22,33]def Func8 (L1): = {} for in Range ( Len (L1)): = l1[i] return dicpri
There are two basic output statements in PHP, Echo and printWhat's the difference between these two things?echo can output one or more characters at a time:Echo "This is a", "string,", "used", "multiple", "parameter." ";Like this, there is no problem with the output.The result of the output is: This is a string that uses more than one parameterThen echo's output is not wrapped, and if you need to wrap it, you can add it later Echo "This is a", "string,", "used", "multiple", "parameter." You can
can improve compatibility3.1 Json.dumps () Import jsondic={'Alex':'+ '# Note the JSON-type string , all in double quotes, at which point the single quote a=json.dumps (DIC)print(a) {"Alex " " - "} # automatically outputs into double quotes, and is compatible with each platformThere is a shortcut, Json.dump (' Sjah ', f)The former is the data that needs to be written, and the latter is the file to be written, which is relatively fast3.2 Json.loads ()Take the JSON type string out, note that i
First, the Python Foundation
About Python
Python data type (numeric \ string \ list)
Python data type (tuple \ Dictionary)
Ii. python file Operations functions Three, Python common module Four, object-oriented development five, network programming--socket Development VI, concurrent Programming VII, MySQL database eight, the front-end development
Front End Introduction
HTML Introduction
Css--css selector for the front end
Front-end css--box model and floating
css--p
first edited September 28, 2017 19:28:36SummaryA. Python installationTwo. VariablesThree. Python operationsHomeworkSummary todaySummaryReferences: Alex
Installation of Python
Python variables and simple process Control
A. Python installation
Installation
Configuring Environment variables
Two. Variables
Role
Name as constant
Three. Python operations
CTRL +? Comments
Getpass
Input
STR int
Process Control
If .
first edited September 30, 2017 21:40:48SummaryA. List supplementsTwo. Shopping Cart procedureThree. DictionariesHomeworkSummary todaySummaryReferences: Alex
Summary of the list
Search and delete of dictionaries
A. List supplements
Clear
Del
Extend
Reverse
Sort
Two. Shopping Cart procedure
IsDigit
Output with color
\033[31;1mxxxxxx\033[0m: RedThree. Dictionaries
Key is unique and the dictionary is unordered
By deletin
" This time triggered the new action, we want to record this behavior, if it is only recorded "Gxqsd a new role" that obviously he is a bit like the message log, but it can not be used for historical records. So the most important thing to do as a behavior log is to record the changes in the data. So there's a new role for GXQSD, and the right approach should be to store the new role entity information.Next, a simple diagram is used to describe the relationship between database tables.We define
.
Computer Vision
Computer Vision Library
OPENCV,SIMPLECV, etc.
Natural Language Processing
NLP-related python libraries
Nltk,jieba, etc.
Machine Learning
Machine Learning Library
Scikit-learn,tensorflow,theano, etc.
Big Data
MapReduce frameworks and libraries
Pyspark,streamparse, etc.
Cloud Tools
Cloud Service-related Python libraries
Aws-cli,apache-libcloud, etc.
=["Jiangxi"]={' Nanchang ': {}, ' Jian ': {}} The second time temp=["Jiangxi" ["Jian"]={} Therefore, the optional node of the current node is empty, in the same vein can continue to add Taihe and other next level node Six, enter B exits this layer node, because the last element of the list of pop deletions is executed, so the path becomes ["Jiangxi"] again, the same way you enter the second time B and then the pop again back to the first level node Seven, enter Q to exit the loop directlyIn th
Baidu Cloud Disk DownloadANGULARJS is the first human-scale MVC framework that can help programmers focus most of their energy on core business logic, thereby significantly improving development efficiency.Stage 2:controllerController is the logical core of ANGULARJS, and a lot of advanced functions are implemented by controllers, this part is the core of Angularjs.Phase 3: Data interactionE-commerce, gaming, social, any application is inseparable from the data support, data interaction is a dev
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.