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 小时前
Linux入门篇学习——Linux 编写第一个自己的命令,make 工具和 makefile 文件
linux·运维·服务器·学习
李白洗一夜2 小时前
(新手友好)MySQL学习笔记(12):触发器,视图,三范式
笔记·学习·mysql
baynk6 小时前
逆向入门(9)汇编篇-bound指令的学习
汇编·学习
茫忙然8 小时前
【WEB】Polar靶场 Day7 详细笔记
笔记
future141210 小时前
游戏开发日记
数据结构·学习·c#
今天背单词了吗98010 小时前
算法学习笔记:17.蒙特卡洛算法 ——从原理到实战,涵盖 LeetCode 与考研 408 例题
java·笔记·考研·算法·蒙特卡洛算法
逐花归海.10 小时前
『 C++ 入门到放弃 』- 多态
开发语言·c++·笔记·程序人生
致***锌11 小时前
期权交易完整版教程简介
笔记
棱镜研途11 小时前
学习笔记丨卷积神经网络(CNN):原理剖析与多领域Github应用
图像处理·笔记·学习·计算机视觉·cnn·卷积神经网络·信号处理
皮蛋sol周12 小时前
嵌入式学习C语言(八)二维数组及排序算法
c语言·学习·算法·排序算法