书生大模型实战营第三期——入门岛——python基础知识

第二关:python基础知识

任务如下:

任务描述
闯关任务 Python实现wordcount
闯关任务 Vscode连接InternStudio debug笔记

1 Vscode连接InternStudio

见第一关教程中vscode远程连接部分。

书生大模型实战营第三期------入门岛------Linux基础知识-CSDN博客

2 Python实现wordcount

python 复制代码
def word_count(text):
    import re
    words = re.findall(r'\b\w+\b', text.lower())
    word_dict = {}
    for word in words:
        if word in word_dict:
            word_dict[word] += 1
        else:
            word_dict[word] = 1
    return word_dict

input_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."""

output = word_count(input_text)
print(output)

3 Vscode连接InternStudio debug笔记

相关推荐
我的xiaodoujiao9 分钟前
API 接口自动化测试详细图文教程学习系列20--结合Pytest框架使用
python·学习·测试工具·pytest
python在学ing26 分钟前
前端-CSS学习笔记
前端·css·python·学习
学习,学习,在学习42 分钟前
Qt工控仪器程序框架设计详解(工控多仪器控制版本)
开发语言·c++·qt
三品吉他手会点灯1 小时前
C语言学习笔记 - 35.数据类型 - printf函数的非输出控制符与格式优化
c语言·开发语言·笔记·学习
JAVA面经实录9171 小时前
Java集合大全终极手册(一)
java·开发语言
信竞星球_少儿编程题库1 小时前
2026年全国信息素养大赛算法应用主题赛 丝路新城 C++ 模拟卷(三)
开发语言·c++
IT策士1 小时前
Django 从 0 到 1 打造完整电商平台:为什么用 Django 做电商?
后端·python·django
千里马-horse2 小时前
gRPC -- Java 基础教程
java·开发语言·grpc
zkkkkkkkkkkkkk2 小时前
Linux进行管理工具Supervisor配置与使用
linux·python·supervisor
甲方大人请饶命2 小时前
Java-面向对象进阶(qqbb知识点)
java·开发语言