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)
相关推荐
zhangrelay1 小时前
新版|-|单片机原理与接口技术-2026持续改进优化-从MEGA2560-ESP32与Wokwi到ROS2-Lyrical与具身智能栈
笔记·单片机·嵌入式硬件·学习
Jimmy2 小时前
深夜突袭:我们的午夜战场
笔记·产品·电子书
志尊宝4 小时前
AI原生前端开发(025):端侧AI实战项目:智能笔记助手
人工智能·笔记·ai-native
lll23526917795 小时前
线下多人发言对比与录音操作
笔记·智能手机
叼烟扛炮5 小时前
Linux 学习笔记(三十三):线程互斥——互斥锁(Mutex)与死锁
linux·运维·服务器·笔记·学习·1024程序员节
m4Rk_7 小时前
【论文阅读】Agent 记忆机制(113):Agentic Memory Management——从“检索相关信息”走向“管理 Agent 内部记忆”
论文阅读·人工智能·学习·开源·github
深圳老胡8 小时前
STM32C5A3ZG 网络调试总结:从启动失败到连续 Ping 稳定
笔记·stm32·单片机·代码规范
辣知8 小时前
辣知·化智92 《山海经》里的史前密码
学习
职豚求职小程序刷题8 小时前
宁德时代社招高岗晋升测评笔试改版了
笔记
CarIise8 小时前
JDBC 与数据库事务核心
数据库·笔记