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)
相关推荐
吃好睡好便好17 分钟前
MATLAB中图像格式的转换
开发语言·图像处理·学习·计算机视觉·matlab
秋田君21 分钟前
Qt_常用控件使用学习
数据库·qt·学习
小黄蚁29 分钟前
LVGL学习笔记(一)
笔记·学习
懿路向前1 小时前
【HarmonyOS学习笔记】2026-07-26 | @Trace 序列化 __ob_ 前缀陷阱与消息持久化
笔记·学习
hanlin031 小时前
刷题笔记:力扣第206题-反转链表
笔记·leetcode·链表
一只小菜鸡..1 小时前
南京大学 操作系统 (JYY) 学习笔记:可执行文件、链接器与 Shebang 的彩蛋
笔记·学习
高铭杰2 小时前
Golang sync.Mutex实现原理学习
java·学习·golang
狗凯之家源码网2 小时前
狗凯源码库学习资源真实价值评测
学习
Bernice橘子2 小时前
职场英语学习计划Day024
学习
奋发向前wcx10 小时前
y1,y2总复习笔记10 2026.7.24
笔记·哈希算法·散列表