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)
相关推荐
chools5 小时前
【AI超级智能体】快速搞懂工具调用Tool Calling 和 MCP协议
java·人工智能·学习·ai
自信150413057595 小时前
重生之从0开始学习c++之模板初级
c++·学习
nashane5 小时前
HarmonyOS 6学习:解决异步场景下Toast提示框无法弹出的UI上下文丢失问题
学习·ui·harmonyos·harmony app
江湖人称小鱼哥7 小时前
Obsidian-Graphify-让你的笔记库自己长出知识图谱
笔记·知识图谱·obsidian·claude code·graphify·卡帕西
苦 涩8 小时前
考研408笔记之计算机网络(三)——数据链路层
笔记·计算机网络·考研408
码喽7号8 小时前
Vue学习七:MockJs前端数据模拟
前端·vue.js·学习
三品吉他手会点灯9 小时前
STM32F103 学习笔记-21-串口通信(第4节)—串口发送和接收代码讲解(中)
笔记·stm32·单片机·嵌入式硬件·学习
雾岛听蓝10 小时前
Qt操作指南:窗口组成与菜单栏
开发语言·经验分享·笔记·qt
EnglishJun11 小时前
ARM嵌入式学习(二十三)--- I2C总线和SPI总线
arm开发·学习
饭后一颗花生米11 小时前
2026 AI加持下前端学习路线:从入门到进阶,高效突破核心竞争力
前端·人工智能·学习