no message

This commit is contained in:
yinjun.chen1
2026-05-18 17:29:42 +08:00
parent 3edc0b7b9f
commit 44a7888fd0
4 changed files with 15 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
# 简单加法
add =lambda x,y:x+y
print(add(100,200))
print("------")
+4
View File
@@ -0,0 +1,4 @@
# 与map在一块使用
numbers = [1,2,3,4]
a= list(map(lambda x:x*2,numbers))
print(a)
+3
View File
@@ -0,0 +1,3 @@
numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
a= list(filter(lambda x: x % 2 == 0, numbers))
print(a)
+4
View File
@@ -0,0 +1,4 @@
students = [('Alice', 85), ('Bob', 90), ('Charlie', 78)]
sorted_students = sorted(students, key=lambda x: x[1])
print(sorted_students)
# 按成绩排序: [('Charlie', 78), ('Alice', 85), ('Bob', 90)]