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)
相关推荐
辣知11 分钟前
辣知·化智73 左丘明留下的那面镜子
学习
qeen8715 分钟前
【QT】 信号与槽初始
开发语言·笔记·qt·学习
旖旎夜光26 分钟前
【LangGraph实战】LangGraph 学习笔记(三):Overwrite、输入输出模式与四大工作流模式
人工智能·笔记·学习·ai·langgraph
艾莉丝努力练剑30 分钟前
【AI大模型接入SDK】C++ ChatSDK使用手册
开发语言·网络·c++·人工智能·学习·大模型
DP DPharness8 小时前
ClearAI、记忆插件与普通笔记,三种让 Agent 记住的路数对比
笔记
爱倒腾的老唐8 小时前
0、元器件——电阻
学习
sunshine22 girl9 小时前
Java学习七 Java 项目实战2-注册业务
java·学习
piikee11 小时前
粤语初学入门:从粤拼、九声六调到开口,一个普通话母语者的练习笔记
笔记·粤语入门·怎么学习粤语
sunshine22 girl11 小时前
Java学习七 Java 项目实战1-项目创建和主页面搭建
java·开发语言·学习
传奇开心果编程12 小时前
【SwiftUI提高练中学】第8课 网络层架构:拦截器、重试、缓存与离线优先
学习·macos·ui·ios·swiftui