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)
相关推荐
Purple Coder6 小时前
BMS学习经验
学习
经济元宇宙7 小时前
摄影培训行业百科:机构选择与学习路径全解析
大数据·人工智能·学习
じ☆冷颜〃7 小时前
实分析与测度论、复分析、傅里叶分析、泛函分析、凸分析概述.
笔记·学习·数学建模·拓扑学·傅立叶分析
星夜夏空998 小时前
STM32单片机学习(10)——GPIO输入
stm32·单片机·学习
kobesdu8 小时前
【ROS2实战笔记-19】ROS2 生命周期节点的启动顺序、状态转换陷阱与热备方案
java·前端·笔记·机器人·ros·ros2
谙弆悕博士8 小时前
快速学C语言——第16章:预处理
c语言·开发语言·chrome·笔记·创业创新·预处理·业界资讯
南境十里·墨染春水9 小时前
linux学习进展 shell编程
linux·运维·学习
handler019 小时前
UDP协议与网络通信知识点
c语言·网络·c++·笔记·网络协议·udp
xwz小王子10 小时前
机器人学习十年进化史——从强化学习到VLA的范式变迁
大数据·学习·机器人
小新同学^O^10 小时前
简单学习 --> WebSocket
java·websocket·网络协议·学习