Strong! Eight Python tips for optimizing speed-up!

Author Wang Zhanghao https://zhuanlan.zhihu.com/p/143052860 Python is a scripting language, which has some shortcomings in efficiency and performance compared to compiling languages such as C/C++. However, there are many times when Python's efficiency is not as exaggerated as you might think. This article summarizes some of the Python code a ...

Posted by gammaster on Mon, 18 Oct 2021 09:47:11 -0700

python learning records - tuples and sets

1. Tuples What is tuple Tuple: One of Python's built-in data structures is an immutable sequence Example: t = ( 'python' , 'hello' , 90 ) Variable and Invariant Sequences Invariant sequence: string, tuple No add, delete, change operations for immutable sequences Variable sequence: list, bullet, set Variable sequences c ...

Posted by crwtrue on Sun, 17 Oct 2021 10:31:10 -0700

Python handles Excel and learns these 14 methods to reduce the workload by more than half!

In the age of python, you have to learn some Python in finance, personnel, administration and other posts, which is easy and brain-saving! All operations are automatically implemented in Python, overtime? It doesn't exist! In fact, excel and python are both tools. We don't need to compare them and study which is easy to use. excel, as the most ...

Posted by z1haze on Sat, 16 Oct 2021 00:05:59 -0700

Introduction to python for beginners - functions, classes, modules, packages

14. Function def calc(a ,b):'''establish''' c=a-b return c; calc1 = calc(10, 20)'''call''' calc2 =calc(b=50,a=60) print(calc1) print(calc2) In the process of function call, parameters are passed If it is an immutable object, the modification of the function body will not affect the value of the argument. The modification of a ...

Posted by markmusicman on Fri, 15 Oct 2021 20:48:19 -0700

Python file operation

1, Create and open files open() method The open() method is used to open a file and return the file object. This function is required during file processing. If the file cannot be opened, OSError will be thrown. Note: when using the open() method, be sure to close the file object, that is, call the close() method. The common form of the open() ...

Posted by kellydigital on Fri, 15 Oct 2021 19:42:33 -0700

pygame development: code implementation of Marseille logic game

This article mainly introduces the development of pygame. Through this article, you can use pygame to develop a Marseille logic game ~ friends in need can use it for reference. I hope it can be helpful 1, Game introduction Marseille logic is a logic game similar to Sudoku and minesweeping. It lights up the square according to the data prompts ...

Posted by HockeyDevil07 on Fri, 15 Oct 2021 13:19:36 -0700

[Python 3 learning notes - basic grammar] how does the input and output function realize dynamic interaction with the computer

In the previous chapters, we have actually touched on the input and output functions of Python. In this chapter, we will introduce the input and output of Python in detail. If you are interested in learning Python together, click the following icon to add a group: Output format beautification Python has two ways to output values: e ...

Posted by yumico23 on Thu, 14 Oct 2021 20:28:25 -0700

❥ ❥ the most complete python operation list in the whole network is coming ❥ ❥ (recommended Collection) (^ -)

Chapter 4 operation list 4.1 traversing the entire list You often need to traverse all the elements of the list and perform the same operation on each element. For example, in a game, you may need to translate each interface element the same distance; For a list containing numbers, you may need to perform the same statistical operation on eac ...

Posted by Rocu on Wed, 13 Oct 2021 08:58:11 -0700

1+X computer vision textual research some knowledge points

Python 1. Python basic syntax 1.1 Python identifier In Python, identifiers consist of letters, numbers, and underscores. In Python, all identifiers can include English, numbers, and underscores (), but cannot begin with a number. Identifiers in Python are case sensitive. Identifiers that begin with underscores have special meaning. St ...

Posted by rulinus on Tue, 12 Oct 2021 20:01:30 -0700

Day17 CSV file, excel file operation and object-oriented programming

day17 - csv file and excel file operation and object-oriented programming (10.12) 1. python reads csv files python read csv file – read csv file Create folder - ctrl+c – ctrl+v add csv file (cancel) utf-8-sig – > signed UTF-8 – > with byte order mark (to ensure safe reading) import csv with open('resource ...

Posted by mk1200 on Tue, 12 Oct 2021 12:54:59 -0700