【发布时间】:2022-01-14 20:31:38
【问题描述】:
var scores: [String: Int] = ["Alex" : 4, "Rocco": 5, "Britney": 3, "Chad": 2, "John": 5]
func removeStudent() -> [String: Int]{
let filtered = scores.filter{ $0.value < 3}
return filtered
}
【问题讨论】:
-
你到底在问什么,代码似乎按预期工作?
-
只是想弄清楚在这个函数之后我如何删除过滤后的对,并没有真正明白我该怎么做((
标签: swift dictionary