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)
相关推荐
2501_9181269130 分钟前
stm32做一个次声波检测器,需要哪些元件
stm32·单片机·嵌入式硬件·学习·个人开发
GocNeverGiveUp1 小时前
大模型学习2-Agent
学习
Bal炎魔1 小时前
AI 学习专题一,AI 实现的原理
人工智能·学习
Ro Jace2 小时前
分岔机制学习
人工智能·学习·机器学习
雾岛听蓝3 小时前
C++11新特性(lambda、包装器)
c++·经验分享·笔记
反向跟单策略3 小时前
期货反向跟单-2025年回顾及2026年展望
大数据·人工智能·学习·数据分析·区块链
yunhuibin3 小时前
GoogLeNet学习
人工智能·python·深度学习·神经网络·学习
xcLeigh4 小时前
Python入门:Python3 正则表达式全面学习教程
python·学习·正则表达式·教程·python3
知识分享小能手4 小时前
PostgreSQL 入门学习教程,从入门到精通,PostgreSQL 16 语法知识点与案例详解(1)
数据库·学习·postgresql
代码游侠4 小时前
Linux驱动复习——驱动
linux·运维·arm开发·笔记·学习