List of operations in python

catalogue 1, Traverse the entire list (for loop) 1. Simply understand the for loop2. Do more in the for loop3. Perform some operations after the for loop 2, Avoid indenting errors 3, Create a list of values 1. Use the function range()2. Create a list of numbers using range()3. Perform simple statistical calculations on the list of numbers4. ...

Posted by spasm37 on Wed, 22 Dec 2021 19:45:09 +0100

[basic learning of Python] 02 introduction to python (number, string, list)

1. Write in front In the code examples that will appear in later articles, the code with a prompt (> > >) runs in IDLE, and the code with a prompt (> > >) acts as an input line, otherwise it is an output line.python comments start with a # sign and end at the end of the line. Comments are used to clarify the code and will not ...

Posted by obscurr on Wed, 22 Dec 2021 12:31:20 +0100

How to choose between list and tuple in python? What's the difference?

Lists and tuple s are two common data structures in Python. Lists and tuples are an ordered collection that can place any data type. In most programming languages, the data types of collections must be consistent. In python, elements in the same list or tuple can be of different types. list=[3,7,'Mar','Feb','Jan'] # The list contains both in ...

Posted by penguin_powered on Tue, 21 Dec 2021 19:54:32 +0100

Summary of common collection classes in Java

Diagram This figure is inaccurate for the underlying implementation method of some implementation classes, which has changed in the new version of JVM, such as HashMap, but the inheritance and implementation relationship has not changed. Solid white arrows are inheritance and blue dashed arrows are implementation. Map HashMap Before ja ...

Posted by mwd2005 on Mon, 20 Dec 2021 16:51:52 +0100

Today, Tsinghua senior told you that the library in python had better be converted from pdf to docx. This library is very easy to use

environment windows 10 64 bitanaconda with python 3.7pdf2docx 0.5.2 preface Converting PDF files into word files is a very common operation. I believe that most people's free solution is to use some online conversion services, but there will be a problem of data leakage. This article introduces an open source free local conversion tool, pdf2d ...

Posted by parijat_php on Mon, 20 Dec 2021 12:33:55 +0100

Python_ Garbage collection mechanism

I Why do I need a garbage collection mechanism When a Python program is running, it needs to open up a space in memory to store the temporary variables generated during running; After the calculation is completed, the result is output to the permanent memory. If the amount of data is too large and the memory space is mismanaged, it is easy to ...

Posted by elementz on Mon, 20 Dec 2021 00:09:51 +0100

Python crawler's scripy framework Spider class

Spider What is it? Spider Is a basic class provided by scripy, and other basic classes contained in scripy (such as CrawlSpider )And custom spider s must inherit this class. Spider Is a class that defines how to crawl a website, including how to crawl and how to extract structured data from its web pages. The source code is as follows: The ...

Posted by rnewman on Thu, 16 Dec 2021 15:49:02 +0100

Modify the lazy list using epoch based reclamation (EBR, a method of domain specific reclamation)

As mentioned earlier, the biggest hidden danger of lazy list is logical deletion, but there is no physical deletion problem. Therefore, EBR first solve d this problem to him. I EBR modification int parse_delete(intset_l_t *set, val_t val) { node_l_t *pred, *curr; int result, validated, isVal; while(1) { //Init pred ...

Posted by jonmkim on Sat, 11 Dec 2021 07:53:27 +0100

The UDP server transmits the list object to the client

https://www.oschina.net/question/1449495_149180 java serialization: Java provides a mechanism for object serialization. In this mechanism, an object can be represented as a byte sequence, which includes the data of the object, information about the type of the object and the type of data stored in the object. After a serialized object is wr ...

Posted by JeremyMorgan on Thu, 09 Dec 2021 14:45:16 +0100

Details of Java performance optimization that affect performance

1, Foreword  details of Java performance optimization affecting performance - continued. I intend to write the whole series of articles with this title slowly. This is the first article entrance . This time, the content mainly comes from the book "actual combat of Java program performance optimization". It is a reading note. Int ...

Posted by rammac13 on Thu, 09 Dec 2021 08:37:07 +0100