I. Yesterday's content review1. ReflectionThe variable that operates the namespace with the name of the string type.Reflection usage Scenario: the obvious simplification of the code, can get the variable name is a string type of time,User input,
The Python dictionary contains the following built-in methods:
Serial Number
Functions and descriptions
1
Radiansdict.clear ()Delete all elements in a dictionary
2
Radiansdict.copy ()Returns a
A python conditional statement determines the code block that executes by executing the result of one or more statements (true or false). You can easily understand the execution of conditional statements.The conditional statements in Python include
Brief introductionAs the saying goes 工欲善其事 its prerequisite, so for programmers, the use of Python programming must have a powerful Python programming tool, this tool is pycharm.Pycharm is a Python IDE with a complete set of tools to help users
dicvisit={}if not Dicvisit.has_key (Visitkey):# does not exist Diaset = set () Diaset.add (diagnosecontent) Dicvisit[visitkey]=diaset #print ("new===" +visitkey + "-----" +diagnosecontent) Else: # take out the corresponding element
XML processing: XML is the implementation of different languages or programs to exchange data between the protocol, like JSON, but JSON is more simple to use, in the dark era of JSON has not been born, we can only choose to use XML Ah, so far many
#可变类型的对象为全局变量时#MAP can iterate directly, no need to write a for loop#方法一:foo = [2,18,9,22,17]# Mapdemo = map (lambda x:x*2+10,foo)# for I in Mapdemo:# Print (i)# #方法二:# def TT (x):# return X*2+10# M=TT# Print ("m={0}". Format (m))# mresult=m (12)#
FunctionWhen the return value of a function is the function name of another function, only the memory address of the function is returned, and the scope of the function does not change.Name ='WINSODM'defTest (): Name='XL' Print('In the
Back to Wen Zhengxu and reverse the same string, for exampleabccbaMethod Onedef is_palindrome1(text): l = list(text) l.reverse() t1 = ‘‘.join(l) if t1 == text: print ‘the text is palindrome‘ else: print ‘the text is not
Collections ModuleThe Collections module provides several additional data types based on the built-in data types (dict, list, set, tuple): Chainmap, Counter, deque, Defaultdict, Namedtuple and Ordereddict and so on.1.namedtuple: Generates a tuple
All: https://www.cnblogs.com/pyyu/p/6702896.html
ABS (x)
Absolute
Divmod (A, B)
Separate pick-up and remainder, note: integer, floating-point type can be
int ([x[, Base]])
Converts a character
1. Arithmetic operation:2. Comparison operation:3. Assignment Operation:4. Logical Operation:5. Member Arithmetic: 1, intPython2 int has range, and long integer typePython3 all the numbers are int no matter how longOn a 32-bit machine, the number of
ElementTree is a python XML processing module that provides a lightweight object model. It becomes part of the Python standard library after Python2.5, but it needs to be installed separately before Python2.4. The import Xml.etree.ElementTree
after we have developed the code, we generally need to export the dependent package, and then migrate to other systems to install, to ensure that the environment is normal Export the Python environment installation package[Email protected] ~]# pip
1, selenium to achieve automation, need to locate elements, the following view 163 mailbox login Elements(1) Login (navigate to the Login box, the login box is an IFRAME, if not located to the IFRAME, is unable to locate the Account box and password
Example:
The code is as follows:
D = {"root": {"Folder2": {"item2": None, "Item1": none}, "Folder1": {"Subfolder1": {"item2": None, "Item1": none}, "Subfolder2": {"Item3": None}}}
The beautiful output is:
Observe the features:1. Key to the same
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