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 分钟前
从300克Ego头环看第一人称数据采集趋势:设备轻量化之后,场景端壁垒在哪
数码相机·学习
笨鸟先飞的橘猫31 分钟前
系统设计第十七天决策卡
学习·游戏
Sunshing151 小时前
Lyapunov方程系统本身稳定性判定与镇定性判定
笔记·学习
透明的玻璃杯2 小时前
热键驱动 Hotkey Features Integration v9.x(14MB)
笔记
sunoo-2293 小时前
51单片机学习Day2:数码管动态扫描、定时器与中断系统深度总
单片机·嵌入式硬件·学习·51单片机
宣宣猪的小花园.3 小时前
【机器学习】从机理建模到数据学习:机器学习究竟替代了什么
人工智能·学习·机器学习
上海心泾国际物流有限公司3 小时前
我在几个医疗器械仓库记下的一组温湿度数据
经验分享·笔记·学习·健康医疗·交通物流
for_ever_love__4 小时前
python基础语法学习: requirements.txt
开发语言·python·学习
for_ever_love__4 小时前
python基础语法学习: 动态类型
开发语言·python·学习
边境悍匪5 小时前
蜗牛学苑 Java 智能体学习 Day40|Vue 工程化与 ElementPlus 思维导图复盘
java·vue.js·学习