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)
相关推荐
一只大鸽子3 小时前
游戏开发笔记12-像素画基础-细节
笔记
YLCHUP9 小时前
【括号匹配+dp优化】题解:双端括号(brackets)_动态规划_状态优化_数学建模_贪心_性质挖掘_STLmap_C++算法竞赛
数据结构·c++·笔记·算法·数学建模·贪心算法·动态规划
云半S一12 小时前
Agent学习总结补充:3
经验分享·笔记·agent·学习分享
console.log('npc')12 小时前
Python第9课 类学习笔记,前端js语法对照
前端·python·学习
摇滚侠14 小时前
《On Java 中文版 基础卷》阅读笔记 内部类 21
java·开发语言·笔记
艾莉丝努力练剑16 小时前
【AI大模型接入SDK】解决Unicode码转化以及界面变形问题
前端·c++·人工智能·学习·安全·架构
一只大鸽子18 小时前
游戏开发笔记13-Godot RPG游戏基础-敌人追击逻辑、玩家死亡、新场景
笔记·godot
落羽弦音19 小时前
深入指针——指针与函数的探析
c语言·经验分享·笔记
饮水桶_T20 小时前
Java调用大语言模型、多轮对话 笔记
笔记·算法·设计模式·电脑·ai编程