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)
相关推荐
晓梦林12 小时前
BUUCTF findKey-学习笔记
笔记·学习
05664612 小时前
agent学习Day15——SQLAlchemy 查询过滤、分页与历史列表接口
python·学习·fastapi
炎武丶航15 小时前
汽车功能测试学习(1):FCW前方碰撞预警
功能测试·学习·汽车
x173880627315 小时前
XXE外部实体注入
xml·笔记
库玛西19 小时前
C++ 运行时多态 :核心总结与原理图解
c语言·c++·笔记
魔力女仆20 小时前
语言开发笔记3
笔记
x173880627320 小时前
文件包含漏洞介绍
笔记
qq_1851986920 小时前
SpingBoot3入门学习一
学习
噗噗夹的TA之旅20 小时前
Shader 学习 21:自定义 Render Feature
学习·游戏·unity·c#·游戏引擎·图形渲染
码农小韩21 小时前
AIAgent应用开发——大模型理论基础与应用(七)
python·学习·ai·大模型·agent