Functional programming experiment 1 / Huake

Task 1 Can the following pattern successfully match L of type int list? If the match is not successful, indicate the type of the pattern? (assuming x is of type int) x::L successful _::_ success x::(y::L) successful (x::y)::L failed, cannot int::int [x, y] successful x::L means to append x to the list L_ Wildcards can represent any t ...

Posted by Dirtbagz89 on Fri, 07 Jan 2022 06:46:13 +0100

Functions and lambda expressions in python

What is a function Function refers to "taking" a name for a piece of code that implements a specific function, and then executing (calling) the function through the name A function can accept zero or more arguments, or return zero or more values Functions need to be clarified 1. The function needs several key data that need to ...

Posted by Cesar on Wed, 05 Jan 2022 14:23:48 +0100

Week 3 - functions and modules in Python

Functions and modules in Python Functions are packages of code that are relatively independent and reusable. 1. Modules and functions in the standard library functionexplainabsReturns the absolute value of a number. For example, abs(-1.3) will return 1.3.binConvert an integer to a binary string starting with '0b'. For example, bin(123) will ...

Posted by matthewlesh on Mon, 03 Jan 2022 03:53:54 +0100

From getting started to mastering Python, 100 days is enough—— Cognitive function

In the previous study, if we need to calculate the factorial of three numbers, we need to write repeated code three times to calculate, which is very troublesome. World class programming master Mr. Martin Fowler once said:“ Code has many bad smells, and repetition is the worst! ". To write high-quality code, the first thing to so ...

Posted by Yesideez on Wed, 29 Dec 2021 12:10:35 +0100

Python basic project: supermarket commodity sales management system

preface In 2020, the sales of double 11 reached a new high, of which tmall's sales exceeded 490 billion yuan and JD's sales exceeded 270 billion yuan. At the same time, the rapid development of live e-commerce contributed a lot to the rapid growth of e-commerce sales during the double 11. In recent years, the double 11 e-commerce shoppi ...

Posted by username123 on Sun, 26 Dec 2021 05:55:03 +0100

II. More detailed functional programming

Write in front Is it still facing Baidu, Google and the process day after day? Have you ever thought about trying to use various design patterns in ordinary business? Think about a thousand roads at night and go the same way in the morning. I have always despised the code written in the past, thinking about refactoring, but I dare not start. M ...

Posted by ozzthegod on Sat, 18 Dec 2021 07:34:20 +0100