我正在尝试将此Python代码转换为F#,而无需使用不可变变量或.我仍然是一个新手。List.map
def findMatches(s,l):
temp=[]
for i in l:
if i[0]==s:
temp.append(i[1])
temp.sort()
return temp
l=findMatches("A",[("A",5),("AA",9),("BB",6),("A",0)])
print(l)
我从以下方面开始:
let findMatches s l =
for e1, e2 in list do
if e1 = s then ...
如果我正朝着正确的方向前进或下一步该去哪里,那就不完全是这样。
斯蒂芬大帝
慕的地10843
狐的传说
随时随地看视频慕课网APP
相关分类