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)
相关推荐
(づど)1 分钟前
一套齐全的环境设置:nvm\node\nrm\pnpm
前端·笔记
陈橘又青14 分钟前
开创性的初创企业利用 Amazon SageMaker孵化器释放企业价值
人工智能·网络协议·学习·ai·编辑器
宵时待雨20 分钟前
C语言笔记归纳21:编译与链接
linux·c语言·开发语言·笔记
走在路上的菜鸟23 分钟前
Android学Dart学习笔记第二十二节 类-扩展方法
android·笔记·学习·flutter
TL滕28 分钟前
从0开始学算法——第二十天(简易搜索引擎)
笔记·学习·算法
你好~每一天37 分钟前
数据分析专员:当传统汽车销售融入AI智能,如何驱动业绩新增长
大数据·数据结构·人工智能·学习·数据分析·汽车·高性价比
✎ ﹏梦醒͜ღ҉繁华落℘40 分钟前
计算机网络学习(三)-- IP地址 和 MAC 地址如何转换,以太网
学习·tcp/ip·计算机网络
铭哥的编程日记1 小时前
后端面试通关笔记:从真题到思路(me)
笔记·面试·职场和发展
秦奈1 小时前
Unity复习学习笔记(七):NGUI
笔记·学习·unity
行业探路者1 小时前
网站二维码的全解析与使用技巧分享
大数据·人工智能·学习·产品运营·软件工程