InternLM学习笔记

入门岛

1. Linux基础知识





2. Python 基础知识

python 复制代码
from collections import Counter


text = """
Got this panda plush toy for my daughter's birthday,
who loves it and takes it everywhere. It's soft and
super cute, and its face has a friendly look. It's
a bit small for what I paid though. I think there
might be other options that are bigger for the
same price. It arrived a day earlier than expected,
so I got to play with it myself before I gave it
to her.
"""


def wordcount(text: str):
    text = text.lower().replace('.', '').replace(',', '').replace('\n', ' ')
    words = [word[:-2] if word.endswith("'s") else word for word in text.split(' ') if word]
    return dict(Counter(words))


if __name__ == '__main__':
    res = wordcount(text)
    print(res)
相关推荐
蒸蒸yyyyzwd1 小时前
cpp选手秋招准备 学习笔记day7 webserver
笔记·学习
lifallen1 小时前
DeepSeek Harness:把 Agent 做成可替换的运行时插件树
人工智能·学习·ai·开源软件·ai编程
自学机械人的小白ing1 小时前
深度学习系统学习
人工智能·深度学习·学习
nmjkhome2 小时前
22 梁单元和谱分析进一步讲解(第47课)-solid works simulation
学习
明快de玄米612 小时前
Electron学习文档
学习·electron·vim
小小de风呀2 小时前
de风——【从零开始学习C++】(十八):AVL树——让二叉搜索树自己“站起来“的自平衡黑科技
c++·科技·学习
MartinYeung53 小时前
[论文学习]MCPTox:面向真实世界MCP服务器的工具投毒攻击基准测试
运维·服务器·学习
Chen—LSN3 小时前
C语言——数据在内存中的存储
c语言·开发语言·经验分享·笔记
math_hongfan3 小时前
事务下单与状态流转:ArkTS 的 JOIN 联表在鸿蒙订单里实战
android·学习·华为·harmonyos
weixin_431600443 小时前
NestJS 入门(9):连上数据库,SQL 写在哪?
数据库·后端·sql·学习·nest.js