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)
相关推荐
你想知道什么?4 小时前
词向量总结-学习笔记
人工智能·笔记·学习
He BianGu4 小时前
【笔记】WPF中RenderOptions类的详细功能
笔记·wpf
用AI来创业吧4 小时前
网站建设公司哪家好:报价差 3 倍,差在哪四项成本上(选型笔记)
笔记·性能优化·软件工程·安全威胁分析
yangmu32034 小时前
开发网站的完整流程:从0到1上线指南
运维·学习
hackchen5 小时前
LangChain 学习第 2 课 - 提示词模板(Prompt Template)
学习·langchain·prompt
一支蜉蝣6 小时前
Day25 XD安全笔记 安全开发-PHP 应用&文件管理模块&包含&上传&遍历&写入&删除&下载&安全
笔记·网络安全·php
Awh-6 小时前
ARM 裸机开发 DAY10 学习笔记
arm开发·笔记·学习
我命由我123456 小时前
动火作业极简理解
学习·职场和发展·产品运营·求职招聘·职场发展·产品经理·学习方法
He BianGu6 小时前
【笔记】WPF中CachingHint的功能
笔记·wpf
andrsted6 小时前
练题簿助学教学:在线刷题、随堂考试,让一门课拥有自己的题库
学习·微信小程序·小程序·学习方法·刷题