Python basic syntax

1, Variables and data types    Python data types are not declared, and the compiler automatically recognizes them. The common data types are as follows; There is no need to add a semicolon at the end of each line of Python code; Python code blocks need to follow strict indentation rules; Python 3 habitually adds parentheses when ...

Added by Theramore on Sun, 27 Feb 2022 10:45:49 +0200

Python text terminal GUI framework, cool

Article 2: super simple! Remove watermarks from images and PDF s Article 3: how to learn Python on Github? Don't miss these popular warehouses! Sort out several common UI frameworks based on text terminals and have a look! Curses The first is Curses[1]. Curves is a dynamic library that can provide the function of text-based terminal wind ...

Added by wizade on Sat, 26 Feb 2022 14:15:40 +0200

In order to monitor the boss, I made a fishing artifact in Python

What fish do ordinary people touch? Chat, microblog, wechat circle of friends, games, novels, stock funds, etc. What is the biggest obstacle to fishing? Of course, it's the contractor (boss). They want workers to work 24 hours a day. However, people's energy is limited. They can only concentrate on working for a few hours a day. Other times ...

Added by andy666 on Sat, 26 Feb 2022 14:06:38 +0200

07 Python common data structures

Common data structures in Python can be collectively referred to as containers. There are three main types of containers: sequence (list, tuple and string), mapping (such as dictionary) and set. 1. Sequence The sequence is ordered, and each element in the sequence has its own number. Python has 6 built-in sequences, including lists, tuples, s ...

Added by tobias on Sat, 26 Feb 2022 13:20:39 +0200

Kaggle Titanic

Kaggle Titanic (1) Question: On April 15, 1912, the Titanic sank, and everyone on board did not have enough lifeboats, resulting in the death of 1502 of the 2224 passengers and crew. Although there are some luck factors in surviving, it seems that some people are more likely to survive than others. Build a prediction model to answer the quest ...

Added by lesmith on Sat, 26 Feb 2022 12:22:42 +0200

[algorithm] sword finger Offer special assault version Day4 array part

[algorithm] sword finger Offer special assault version Day4 array part Title address: https://leetcode-cn.com/study-plan/lcof/?progress=wgzvtig Objective: summarize key points and share ideas Note: under reasonable conditions, only use the code that is the simplest to understand and practical to use I [medium] 010 Subarray with and k ...

Added by 00king00 on Sat, 26 Feb 2022 12:04:35 +0200

Quick sort and its optimization super detailed answer + code (real understanding)

Original text: https://zhuanlan.zhihu.com/p/...Welcome to my Zhihu: https://www.zhihu.com/people/...QuickSort adopts the divide and conquer method, which divides the array linked list or other element sets into the to be sorted set and the sorted set, and converts the elements of the to be sorted set into the sorted set in one iteration until a ...

Added by vaavi8r on Sat, 26 Feb 2022 07:29:10 +0200

Python calculates the cost of books purchased by the whole class

As the Secretary of the League branch and the monitor, there are too many materials and data in the whole class. Although office software can solve many data processing problems, learning the major of programming itself should reflect the level of the major. In addition, it is necessary to count which students in the class buy which books and u ...

Added by alsinha on Sat, 26 Feb 2022 05:20:34 +0200

Are you sure you don't know about python anonymous functions anymore?

The previous chapter described custom functions, while anonymous functions are a special case of custom functions. It only needs one line to define functions and has a cool name 'lambda' 1, Foundation # definition lambda arg1,arg2,arg3,...argn:expression # For example, the previously defined my_sum function def my_sum(num1, num2): re ...

Added by wheelbarrow on Fri, 25 Feb 2022 15:15:13 +0200

Python Chapter 4 object oriented

object-oriented 1. Overview (just understand) # Object Oriented Programming (OOP) is a programming idea and a design and programming method to solve software reuse. # The essence is an abstract thinking process embodied in the establishment of a model. The model is used to reflect the characteristics of things in the real world. # Any kind of ...

Added by bskauge on Fri, 25 Feb 2022 15:12:03 +0200