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)
相关推荐
偷偷的卷14 分钟前
【算法笔记 11】贪心策略六
笔记·算法
河铃旅鹿1 小时前
Android开发-java版:布局
android·笔记·学习
奋斗的牛马1 小时前
FPGA--zynq学习 PS与PL交互(二) HP接口
单片机·嵌入式硬件·学习·fpga开发·信息与通信
华清远见成都中心1 小时前
分享一个驱动开发工程师学习路线图
驱动开发·学习
im_AMBER2 小时前
React 18
前端·javascript·笔记·学习·react.js·前端框架
yun68539922 小时前
读书之反思系统架构设计原则_个人笔记
笔记
d111111111d4 小时前
STM32中为什么会有APB1和APB2两个外设有什么区别
笔记·stm32·单片机·嵌入式硬件·学习
化作星辰5 小时前
深度学习_神经网络中最常用的学习率优化算法
深度学习·神经网络·学习
71-35 小时前
C语言练习题——判断水仙花数(0-100000)
c语言·笔记·学习
FAREWELL000755 小时前
Lua学习记录(3) --- Lua中的复杂数据类型_table
开发语言·学习·lua