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)
相关推荐
小飞在努力15 小时前
【实现负载均匀在线判题⑤】MVC 架构搭建与 Model 题目数据模块实现
c语言·开发语言·c++·笔记·后端
叼烟扛炮18 小时前
[LangChain] 学习笔记(24):流式不改总耗时,只改「多久看到第一个字」——实测差 3 倍
笔记·学习·langchain
小飞在努力19 小时前
【实现负载均匀在线判题④】接入 cpp-httplib 实现编译服务 HTTP 网络化
c语言·开发语言·c++·笔记·http
蜡笔小谢1 天前
DeepSeek Harness Java 实战笔记(五)|插件、MCP 与 Skill
java·笔记·ai·agent·deepseek·harness
半扇排骨1 天前
特别篇:在线 XSS 靶场 haozi 分享与通关笔记
学习·安全·靶场·xss
琳少_1 天前
java程序设计笔记
java·开发语言·数据库·笔记
摇滚侠2 天前
《On Java 中文版 基础卷》阅读笔记 接口 19
java·开发语言·笔记
虎符饼干2 天前
用WebHook把AI文章推送到自建官网,接收端需要具备哪些处理与发布能力?
笔记
吃我一窝jio2 天前
Java多线程核心知识点梳理
java·开发语言·笔记
星恒随风2 天前
从0实现C++ AI大模型接入SDK(二):AI知识科普——从图灵测试到ChatGPT,人工智能的发展历程
linux·c++·人工智能·笔记·chatgpt