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)
相关推荐
小弥儿33 分钟前
GitHub今日热榜 | 2026-09-04:Agent省 token 成今日主线
学习·开源·github
前端精髓43 分钟前
NestJS 是什么(对着 Spring Boot 一起学习)
spring boot·后端·学习
kyrie_sakura1 小时前
MySQL数据库学习笔记2--系统函数(分组,单行,窗口函数)
数据库·学习·mysql
dadaobusi2 小时前
学习:XS-Gem5参数
学习
沪上企服通2 小时前
代账数据的可移植性设计:开放接口、账套导出与 exit strategy 工程笔记(上海 5 家样本对照)
笔记·策略模式
江湖人称菠萝包2 小时前
【Windows】《深入浅出Windows API程序设计:编程基础篇》笔记-Chapter8-子窗口控件
windows·笔记
LearnYard3 小时前
技术博主实测:2026年大语言模型辅助学习工具横向对比
人工智能·学习·语言模型
M78佐菲3 小时前
HTML学习笔记
linux·笔记·学习·tcp/ip·html
我还可以再学点4 小时前
QUIC学习笔记
笔记·学习
火眼金睛炼单词4 小时前
单词发音学习深度解读:方法步骤与优化策略
人工智能·学习