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)
相关推荐
问君能有几多愁~2 小时前
C++ 数据结构复习笔记
数据结构·c++·笔记
r_oo_ki_e_2 小时前
Java Map 集合学习笔记
java·笔记·学习
笨鸟先飞的橘猫3 小时前
skynet——sharetable学习
学习·skynet
liuyicenysabel4 小时前
大模型学习笔记 · 第八篇 · 进阶:偏好对齐与多卡训练
人工智能·笔记·学习
Funing77 小时前
FreeRTOS学习day1:Keil 工程配置与 FreeRTOS 链表机制理解
数据结构·学习·链表
心中有国也有家7 小时前
使用 DevEco Studio 配置 Flutter 鸿蒙签名
学习·flutter·华为·harmonyos
灯澜忆梦7 小时前
MySQL 完整学习路线
学习·mysql
番茄育学园7 小时前
我的三款主流云存储音乐库实测笔记
笔记·分类·媒体
森林古猿18 小时前
再论斜率优化
c++·学习·算法
心中有国也有家8 小时前
鸿蒙Flutter开发环境从零搭建教程(Windows/macOS双平台·避坑版)
学习·flutter·华为·harmonyos