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)
相关推荐
wdfk_prog37 分钟前
[Linux]学习笔记系列 -- [drivers][i2c]i2c-dev
linux·笔记·学习
土拨鼠烧电路1 小时前
笔记03:业务语言速成:“人、货、场”模型与IT系统全景图
笔记
2301_812731412 小时前
CSS3笔记
前端·笔记·css3
越努力越幸运5082 小时前
CSS3学习之网格布局grid
前端·学习·css3
chillxiaohan2 小时前
GO学习记录——多文件调用
开发语言·学习·golang
小乔的编程内容分享站3 小时前
记录使用VSCode调试含scanf()的C语言程序出现的两个问题
c语言·开发语言·笔记·vscode
中屹指纹浏览器4 小时前
2026年指纹浏览器技术迭代与风控对抗演进
经验分享·笔记
1104.北光c°4 小时前
【从零开始学Redis | 第一篇】Redis常用数据结构与基础
java·开发语言·spring boot·redis·笔记·spring·nosql
Funny_AI_LAB4 小时前
AI Agent最新重磅综述:迈向高效智能体,记忆、工具学习和规划综述
人工智能·学习·算法·语言模型·agi
代码游侠5 小时前
学习笔记——Linux内核与嵌入式开发1
linux·运维·前端·arm开发·单片机·嵌入式硬件·学习