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)
相关推荐
tiankongdeyige7 小时前
游戏战斗系统学习第2篇:有限状态机 (FSM)
学习·游戏·typescript
an12321219 小时前
ARM嵌入式学习笔记:SPI通信协议详解
arm开发·笔记·学习
by2099910 小时前
从结构体到对象:正式学习C++类的骨架、封装与this指针
c++·经验分享·学习
乌暮10 小时前
深入理解 Java 泛型:把「万能盒子」用对、用稳
java·开发语言·后端·学习
小雪崩11 小时前
嵌入式学习 day60:ARM汇编——触摸屏与SPI
汇编·arm开发·学习
问天_观心12 小时前
大模型训练与推理优化(二)
人工智能·深度学习·学习·大模型·transformer
Because_of_Her112 小时前
dfs-洪水填充技巧
笔记·算法·深度优先·洪水填充
xzal1212 小时前
GESP Python笔记
笔记·python·算法
周玉奎先生13 小时前
CGM系列水泥基灌浆料型号参数解析及安庆重点工程应用匹配
经验分享·笔记·零售
海海不掉头发13 小时前
软件项目管理学习笔记-从软件危机到敏捷与DevOps
笔记·学习·devops