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)
相关推荐
longxiangam7 小时前
esp-idf 中 mipi dsi 使用的笔记
笔记
喜欢踢足球的老罗7 小时前
从移动开发转型 AI Agent 工程师:我做了一个开源学习系统
人工智能·学习
EntyIU8 小时前
JVM内存与GC笔记
java·jvm·笔记
wuxinyan1238 小时前
工业级大模型学习之路030:Streamlit 企业级智能体前端工作台
前端·学习·streamlit·智能体
长安紫薯9 小时前
学习AI日记
学习
星恒随风9 小时前
C语言数据结构排序算法详解(下):冒泡排序、快速排序、归并排序和计数排序
c语言·数据结构·笔记·学习·排序算法
NagatoYukee9 小时前
Spring Security基础部分学习
java·学习·spring
米小葱9 小时前
【学习笔记】cmake
笔记·学习
辰海Coding10 小时前
MiniSpring框架学习-分解 Dispatcher
java·学习·spring·架构
初夏睡觉10 小时前
数据结构学习之~二叉堆 (P3378 【模版】堆)
数据结构·c++·学习