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)
相关推荐
淮南颂恩少儿编程C++6 分钟前
在淮南:编程信息学培训与 C++ 信奥赛:从 CSP 到 NOI 的进阶之路
人工智能·学习·青少年编程
闪闪发亮的小星星14 分钟前
卫星通信、主要业务类型、组成
笔记
十月的皮皮38 分钟前
C语言学习笔记20260612-菱形图案打印(两种写法)
c语言·笔记·学习
chase。1 小时前
【学习笔记】RIGVid:通过模仿生成视频实现机器人操作,无需物理演示
笔记·学习·音视频
c7691 小时前
【文献笔记】Learn to Relax with LLMs: Solving COPs via Bidirectional Coevolution
论文阅读·人工智能·笔记·语言模型·论文笔记·提示工程
不爱土豆唯爱马铃薯1 小时前
MC-030 | 从学习到生产
学习
zhangle1hao1 小时前
从零开始学习ai agent开发
人工智能·学习
2401_872418781 小时前
Slide AI — 智能课件学习助手
人工智能·学习
Bnews1 小时前
买家电一对一的定制服务推荐:2026年618期间的专业选择指南
经验分享·笔记
佛系豪豪吖1 小时前
AtomCode 部署流程与使用经验
笔记·chatgpt·github·ai编程·gitcode