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)
相关推荐
loopne2 分钟前
AI网文写作实验笔记(十三):系列总结——12 篇实验、8 条核心结论,把“AI 写小说“每一步拆开验证
人工智能·经验分享·笔记·ai写作·智能写作
M78佐菲21 分钟前
Linux多线程:创建、回收与互斥同步
linux·笔记·学习·算法
sunoo-2291 小时前
【Linux 系统编程】学习第七天:线程属性 | 互斥锁 | 死锁 | 信号量 核心知识点 + 踩坑实战
linux·c语言·笔记·vscode·学习
Romantic_love_1 小时前
USART串口初始化源码解析
stm32·单片机·嵌入式硬件·学习
小雪崩1 小时前
嵌入式学习 day33:线程进阶
linux·c语言·学习
LccKyI1 小时前
C#基础编程 面试题汇总(三)
笔记·c#
MartinYeung52 小时前
[论文学习]AI-Trader:实时金融市场中自主代理的基准测试
人工智能·深度学习·学习
懿路向前2 小时前
【HarmonyOS学习笔记】2026-08-27 | 端插件踩坑与设计取舍
笔记·学习·harmonyos
QuZhengRong2 小时前
【AI】Agent 全栈进阶|Agent 设计模式
人工智能·学习·设计模式·llm·agent
ouynagda2 小时前
Linux多线程:互斥锁与信号量学习笔记
linux·笔记·学习