Prime numbers: Numbers that can be divisible by 1 and the book () any prime number has two factors that are 1 and prime numbers themselves, such as 1,2,3,5,7,11 is prime, and 4,6,8,9 is not prime, and they can be divisible by 2 or 3.Factors: 1,2,4 (1
Job: Writing the Login interface
Enter User name password
Show welcome message after successful authentication
Three-time error after locking
Import sys, OS, getpassOs.system (' Clear ')i =0While I 3:# The exception does not
Python Learning Note 3: Lists and tuplesA list of listsSummary: The list is a mutable variable, and you can modify the value of the element by subscript1. Definition list --brackets []name=[' Lily ', ' Lucy ', ' Meimei ' 2, subscript value --plus
What is recursion? Simply put: The function itself calls itself."Ordinary programmers use iterations, genius programmers use recursion"Although recursive at run time will constantly out stack stack, call the underlying register, resulting in space
Error found when using class to locate elements:Error message: Selenium.common.exceptions.InvalidSelectorException:Message:Compound class names not permitted (the name of the composite class is not allowed)Online inquiry information
Python processing is a big hole in the time zone when dealing with the conversion of datetime and timestamp in Python.Because the python time is handled by the default localtime input, the script runs locally and runs on the server, resulting in a
one, python in the file, folder operations often used in the OS module and Shutil module common methods. 1. Get the current working directory, that is, the directory path of the current Python script work: OS.GETCWD ()2. Return all files and
Python Learning Note 2: StringsSummary : strings are immutable variables and cannot be modified by subscriptThe method of the string does not change the original value of the string, but it is reborn into a stringOne or 3 ways of writing--single
One: moduleA module is a py file, which defines some business functions. Reference modules, which can be imported using Import statements. After the module is imported, the function in the module is used by the module. Function name (parameter) . If
1. Namespace Python has three namespaces built-in namespaces: the execution of the print (sum) print (max) global namespace: file generates a global namespace as the Python interpreter launches. Refers to a file-level definition name that will be
The meaning of reflection: Gets the memory address of a method of a class through a string, and calls the method.Format: If hasattr(self, ' anattr ')Func = getattr(self, ' anattr ') #获取内存地址Func () # calls the method, equivalent to Anattr () setattr(
Abnormal:
Exception (Exception): Occurs because of a run-time error, resulting in a traceback
"Traceback" is a detailed description of the run-time errors that occur
Common exceptions: (To be perfected)
ValueError occurs
Source: Link: http://pan.baidu.com/s/1dEK82hb Password: 9floCreate Project Scrapy startproject Tutorial Crawl scrapy crawl D Moz Crawl and Save as JSON format Scrapy crawl Dmoz-o items.json-t JSONscrapy Shell "url/resource" will be able to get
This article mainly briefly describes the use of the Len () function in Python, including the use of small examples in four cases, is the basic knowledge of Python learning, the need for friends can refer to the following
function: Len ()
1:
Python's magic methods are typically named in MethodName, such as: Init (construction method), GetItem, SetItem (subscriptable required method), Delitem (del Obj[key] Required method) , Len (Len (...) Required method) and so on.
In Python, if we
first, the basic form
Sorted (iterable[, cmp[, key[, reverse]]) Iterable.sort (cmp[, key[, reverse])
Parameter explanation:(1) iterable specifies the list or iterable to sort, not to mention;(2) CMP is a function that specifies a function to
Python -- quickly identify data differences between two workbooks, python workbooks
Recently, I just got started with python and found some small tasks to train my hands. I hope I can continue to improve my problem solving skills in practice.
In the
Python functions (II): python Functions
Continue to explain the function today:Directory:
1. function object
2. Function nesting
3. namespace and scope
4. Closure
5. decorator
6. iterator
7. Generator
8. built-in functions
Part 1: Function
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