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)
相关推荐
派大猩猩_5 分钟前
Obsidian U盘里的笔记库怎么安家?2026 随身库转云端主库
笔记·obsidian·obsidian插件·obsidian同步·obsidian同步插件
陈年老古董9 分钟前
Function Calling 实战:从自然语言生成 SQL 到多轮工具调用
sql·学习·语言模型·langchain·tool
柳鲲鹏12 分钟前
梦笔记20291203
笔记
欢欢李21 分钟前
【LTE L3 笔记 53】LTE下行动态功率控制
笔记·无线通信·物理层·lte·空口协议
Rabitebla24 分钟前
【Linux】文件系统(四):目录、路径解析与 dentry 缓存
linux·数据结构·c++·笔记·学习·算法·缓存
Z21-X1 小时前
云原生运维学习笔记:Kubernetes 动态卷供应与 StatefulSet 实战
运维·笔记·学习·云原生·kubernetes
sharemylove1 小时前
Java 继承与权限修饰符 学习笔记
java·开发语言·笔记·学习·课程设计
Monkey的自我迭代1 小时前
K8S详细学习1——为什么选择k8s
学习·docker·kubernetes
inferno1 小时前
Java泛型学习笔记(二)
java·笔记·学习
一只大鸽子3 小时前
游戏开发笔记19-Godot RPG游戏基础-文本样式
笔记·游戏·godot