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)
相关推荐
挨踢学霸1 分钟前
技术全面重构|MsgHelper 新版深度拆解:交互、视觉与逻辑的底层优化(二)
经验分享·笔记·微信·架构·自动化
Nan_Shu_6143 分钟前
学习: 尚硅谷Java项目之小谷充电宝(3)
java·后端·学习
头疼的程序员5 分钟前
计算机网络:自顶向下方法(第七版)第三章 学习分享(二)
网络·学习·计算机网络
星期五不见面9 分钟前
AI学习(三)openclow启动(2)2026/03/05
学习
weixin_4434785124 分钟前
flutter组件学习之Flex / Expanded弹性布局组件
javascript·学习·flutter
OxyTheCrack27 分钟前
【C++】简述Observer观察者设计模式附样例(C++实现)
开发语言·c++·笔记·设计模式
im_AMBER31 分钟前
Leetcode 136 最小栈 | 逆波兰表达式求值
数据结构·学习·算法·leetcode·
Xzq21050938 分钟前
网络基础学习(一)
网络·学习
Fuliy9643 分钟前
第三阶段:进化与群体智能 (Evolutionary & Swarm Intelligence)
人工智能·笔记·python·学习·算法
ejinxian44 分钟前
Go语言完整学习规划(2026版)- Part 1
学习·go