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)
相关推荐
Nan_Shu_6142 小时前
学习:ES6(2)
前端·学习·es6
河铃旅鹿3 小时前
Android开发-java版:Framgent
android·java·笔记·学习
自动化代码美学6 小时前
【Python3.13】官网学习之控制流
开发语言·windows·python·学习
AA陈超7 小时前
ASC学习笔记0020:用于定义角色或Actor的默认属性值
c++·笔记·学习·ue5·虚幻引擎
IMPYLH8 小时前
Lua 的 collectgarbage 函数
开发语言·笔记·junit·单元测试·lua
檐下翻书1738 小时前
从入门到精通:流程图制作学习路径规划
论文阅读·人工智能·学习·算法·流程图·论文笔记
SalvoGao8 小时前
Python学习 | 怎么理解epoch?
数据结构·人工智能·python·深度学习·学习
思成不止于此9 小时前
深入理解 C++ 多态:从概念到实现的完整解析
开发语言·c++·笔记·学习·多态·c++40周年
Highcharts.js9 小时前
学习 Highcharts 可视化开发的有效途径
学习·数据可视化·highcharts·图表开发·可视化开发
胡童嘉9 小时前
长沙烈焰鸟网络科技有限公司实习day12+软件测试学习day3日记
学习