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)
相关推荐
minglie118 分钟前
zynq的网口和串口透传
学习
神奇的小猴程序员19 分钟前
学习查理・芒格思维模型,整理自用资料查阅渠道
学习
xian_wwq28 分钟前
【学习笔记】提示词注入完全指南:五种变体,一套防御体系
笔记·学习·ai安全
元直数字电路验证28 分钟前
云计算实验笔记(二):PaaS 与容器化 —— 从 Docker 命令到 Kubernetes 全景图
笔记·云计算·paas
chushiyunen31 分钟前
php包管理工具composer笔记
笔记·php·composer
做cv的小昊31 分钟前
计算机图形学:【Games101】学习笔记06——几何(曲线和曲面、网格处理)、阴影图
c++·笔记·学习·游戏·图形渲染·几何学·光照贴图
2601_9611940232 分钟前
2026初级会计实务电子书pdf|官方教材+精讲笔记PDF
笔记·pdf
会编程的土豆35 分钟前
网络基础核心笔记(HTTP、TCP、前后端通信)
网络·笔记·http
AOwhisky44 分钟前
MySQL 学习笔记(第二期):SQL 语言之库表操作与数据类型
linux·运维·数据库·笔记·sql·学习·mysql
段一凡-华北理工大学1 小时前
工业领域的Hadoop架构学习~系列文章11:Kerberos安全认证
数据仓库·hadoop·学习·架构·高炉炼铁·工业智能体·高炉炼铁智能化