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)
相关推荐
lizhihai_994 小时前
股市学习心得-AI算力20大硬件四金刚
学习
卖芒果的潇洒农民4 小时前
【0417】学习路线
学习
xzal125 小时前
python中,turtle基础知识笔记1
笔记·python·turtle
han_hanker5 小时前
RequestAttributes , ServletRequestAttributes学习
学习
weixin_513449966 小时前
PCA、SVD 、 ICP 、kd-tree算法的简单整理总结
c++·人工智能·学习·算法·机器人
鱼鳞_6 小时前
Java学习笔记_Day29(异常)
java·笔记·学习
嵌入式小企鹅7 小时前
DeepSeek-V4昇腾首发、国芯抗量子MCU突破、AI编程Agent抢班夺权
人工智能·学习·ai·程序员·算力·risc-v
Amazing_Cacao7 小时前
CFCA精品可可产区认证课程风土解析(亚洲):撕开标签伪装,将微气候差异转化为可用变量
学习
我的xiaodoujiao7 小时前
API 接口自动化测试详细图文教程学习系列11--Requests模块3--测试练习
开发语言·python·学习·测试工具·pytest
九成宫8 小时前
IT项目管理期末复习——Chapter 8 项目质量管理
笔记·项目管理·软件工程