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)
相关推荐
TheSumSt8 小时前
Python丨课程笔记Part3:语法进阶部分(控制结构与基础数据结构)
数据结构·笔记·python
.鸣8 小时前
set和map
java·学习
confiself9 小时前
MAI-UI技术报告学习
学习
IT19959 小时前
Qt笔记-使用SSH2进行远程连接linux服务器并上传文件
linux·服务器·笔记
利刃大大10 小时前
【2025年度创作总结】从笔记到实践,从思考到生活融合
笔记·生活
知识分享小能手11 小时前
Ubuntu入门学习教程,从入门到精通,Ubuntu 22.04文件压缩与解压缩知识点详解(12)
linux·学习·ubuntu
航Hang*11 小时前
Photoshop 图形与图像处理技术——第1章:数字图像基本知识
图像处理·笔记·ui·photoshop
iconball12 小时前
个人用云计算学习笔记 --37 Zabbix
运维·笔记·学习·云计算·zabbix
FPGAI13 小时前
Java学习之计算机存储规则、数据类型、标识符、键盘录入、IDEA
java·学习
Yiii_x14 小时前
Object类与包装类
java·经验分享·笔记·课程设计·ai编程