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)
相关推荐
帅得不敢出门21 分钟前
Android Framework学习二:Activity创建及View绘制流程
android·java·学习·framework·安卓·activity·window
Charlotte's diary32 分钟前
虚拟局域网(VLAN)实验(Cisco Packet Tracer)-路由器、交换机的基本配置
经验分享·学习·计算机网络
帅云毅42 分钟前
文件操作--文件包含漏洞
学习·web安全·php·xss·印象笔记
向風而行1 小时前
HarmonyOS NEXT第一课——HarmonyOS介绍
学习·华为·harmonyos
L10732034822 小时前
深度学习笔记40_中文文本分类-Pytorch实现
笔记·深度学习·分类
李匠20244 小时前
C++负载均衡远程调用学习之TCP连接封装与TCPCLIENT封装
c++·网络协议·学习·tcp/ip
不太可爱的叶某人5 小时前
【学习笔记】深入理解Java虚拟机学习笔记——第2章 Java内存区域与内存溢出异常
java·jvm·笔记·学习
李匠20246 小时前
C++学习之shell高级和正则表达式
c++·学习
寻丶幽风6 小时前
论文阅读笔记——TesserAct: Learning 4D Embodied World Models
论文阅读·笔记·机器人·具身智能·世界模型
李匠20248 小时前
C++负载均衡远程调用学习之QPS性能测试
c++·学习