通过真正的 Python 交互式测验掌握 Python – 测试您的技能
通过 Real Python 的交互式测验检查您的 Python 学习进度并将您的技能提升到新的水平。
我们创建了这些在线 Python 测验,作为您检查学习进度和测试技能的有趣方式。
每个测验都会带您回答一系列问题。其中一些是多项选择,一些会要求您输入答案,还有一些会要求您编写实际的 Python 代码。当您完成每个测验时,它会记录您回答正确的问题的分数。
在每次测验结束时,您都会收到基于您的结果的评分。如果您第一次尝试时没有获得 100% 的分数,请不要担心!这些测验旨在挑战您,并且希望您多次完成这些测验,从而在每次运行中提高您的分数。
参加测验: 通过我们的交互式“Python 技能测试”测验来测试您的知识。完成后您将收到一个分数,以帮助您跟踪学习进度:
互动测验
Python技能测试
通过包含基础到高级问题的技能测验来测试您的 Python 知识。您是新手、中级、熟练还是专家?
互动测验
Python 网页抓取实用介绍
在本测验中,您将测试您对 Python 网络抓取的理解。网页抓取是数据收集和分析的强大工具。通过完成此测验,您将重新了解如何使用字符串方法、正则表达式和 HTML 解析器解析网站数据,以及如何与表单和其他网站组件交互。
互动测验
Astral 的 Python ty 类型检查器
测试您对 Astral ty 的了解——一个速度极快、由 Rust 驱动的 Python 类型检查器。您将了解安装、使用、规则配置以及该工具的当前限制。
互动测验
Python 中的基本输入和输出
在本测验中,您将测试您对 Python 用户交互内置函数(即 input() 和 print())的理解。这些函数允许您分别从键盘捕获用户输入并将输出显示到控制台。
互动测验
Beautiful Soup:使用 Python 构建网络爬虫
在本测验中,您将使用 Python 测试您对网络抓取的理解。通过完成此测验,您将重新了解如何检查目标站点的 HTML 结构、破译 URL 中编码的数据以及使用 Requests 和 Beautiful Soup 来抓取和解析数据。
互动测验
Python 中的位运算符
通过重新审视按位 AND、OR、XOR、NOT、移位、位掩码及其应用等核心概念,测试您对 Python 位运算符的理解。
互动测验
使用 Django、GraphQL 和 Vue 构建博客
在本测验中,您将测试您对构建 Django 博客后端和 Vue 前端以及使用 GraphQL 在它们之间进行通信的理解。这将帮助您解耦后端和前端,处理 API 中的数据持久性,并在单页应用程序 (SPA) 中显示数据。
互动测验
构建吉他合成器
在本测验中,您将测试您对如何使用 Python 构建吉他合成器的理解。通过完成此测验,您将重新审视音乐理论和声音合成中的一些关键概念。
互动测验
使用 TDD 在 Python 中构建哈希表
了解 Python 哈希如何将值分散到存储桶中并为哈希表提供动力。练习碰撞、均匀分布和测试驱动开发。
互动测验
使用 LangChain 构建 LLM RAG 聊天机器人
在本测验中,您将测试您对使用 LangChain 和 Neo4j 构建检索增强生成 (RAG) 聊天机器人的理解。这些知识将使您能够创建自定义聊天机器人,该机器人可以根据结构化和非结构化数据检索并生成上下文相关的响应。
互动测验
使用 Python 的 argparse 构建命令行界面
在本测验中,您将测试您对使用 argparse 模块在 Python 中创建命令行界面 (CLI) 的理解。这些知识对于创建用户友好的命令行应用程序至关重要,这在开发、数据科学和系统管理中很常见。
互动测验
选择最适合编程的字体
在本测验中,您将测试您对如何为日常编程选择最佳字体的理解。您将收到有关选择编程字体时要考虑的技术细节和功能的问题,并刷新您有关如何识别高质量编码字体的知识。
互动测验
Python 中的控制流结构
在本测验中,您将测试您对 Python 控制流结构的理解,其中包括条件、循环、异常处理和结构模式匹配。加强这些技能将帮助您编写更加动态、智能和健壮的 Python 代码。
互动测验
Python 中的数据类
在本测验中,您将测试您对 Python 数据类的理解。数据类是 Python 3.7 中引入的一项功能,是一种主要用于存储数据的类。它们已经实现了基本功能,例如实例初始化、打印和比较。
互动测验
Python 中的深拷贝与浅拷贝
测试您对 Python 中深复制和浅复制的理解。检查分配、标识以及如何正确复制复杂对象。
互动测验
定义和调用Python函数
练习在 Python 中定义和调用函数,包括参数、参数类型、默认值和函数文档。
互动测验
定义和调用Python函数
在本测验中,您将测试您对如何定义自己的 Python 函数的理解。您将重新审视基础知识和更复杂的语法(例如 args 和 kwargs),以加深您对 Python 中函数定义的了解。
互动测验
在 Python 中定义主要函数
在本测验中,您将测试您对 Python main() 函数和特殊 __name__ 变量的理解。有了这些知识,您将能够了解在 Python 中定义 main() 的最佳实践。
互动测验
定义您自己的 Python 函数
在本测验中,您将测试您对定义和调用 Python 函数的理解。您将重新访问 def 关键字、参数、实参等。
互动测验
Python 中的字典
测试您对 Python 字典数据类型的了解:如何使用内置方法和运算符创建、访问和修改键值对。
互动测验
记录 Python 代码:完整指南
在本测验中,您将测试您对记录 Python 代码的理解。有了这些知识,您将能够有效地记录您的 Python 脚本和项目,使它们更易于理解和维护。
互动测验
使用 Pytest 进行有效测试
在本测验中,您将测试您对 pytest(一种 Python 测试工具)的理解。有了这些知识,您将能够编写更高效、更有效的测试,确保您的代码按预期运行。
互动测验
使用 pandas 探索您的数据集
测试您的 pandas 基础知识:核心结构、索引、过滤、分组、数据类型和组合 DataFrame。
互动测验
探索 Python 中的关键字
测试您对 Python 关键字的理解,包括常规关键字和软关键字的区别、关键字类别以及常见陷阱。
互动测验
探索 Python 中的协议
测试您对 Python 协议、结构子类型和静态类型检查(包括泛型和子协议使用)的了解。
互动测验
探索 Python 闭包:示例和用例
在本测验中,您将测试您对 Python 闭包的理解。闭包是函数式编程语言中的一个常见功能,在 Python 中特别流行,因为它们允许您创建基于函数的装饰器。
互动测验
探索 Python T 字符串
探索 Python 的 t 字符串,包括它们的语法、用例以及与 f 字符串和旧方法的差异。
互动测验
与浪链的第一步
大型语言模型(LLM)已经风靡全球。在这个分步视频课程中,您将学习如何使用 LangChain 库来构建 LLM 辅助的应用程序。
互动测验
F 字符串中的格式浮动
在本测验中,您将测试您对如何在 Python 中格式化 f 字符串中的浮点数的理解。当您将浮点数合并到格式化字符串中时,这些知识将使您能够控制浮点数的精度和外观。
互动测验
Python 中的函数式编程:何时以及如何使用它
在本测验中,您将测试您对 Python 函数式编程的理解。您将重新回顾一些概念,例如 Python 中的函数是一等公民、lambda 关键字的使用以及使用 map()、filter() 和 reduce() 实现函数代码。
互动测验
使用 DALL·E 和 OpenAI API 生成图像
在本测验中,您将测试您对使用 Python 通过 OpenAI 的 DALL·E 生成图像的理解。您将重新回顾一些概念,例如使用 OpenAI Python 库、调用 API 来生成图像、根据文本提示创建图像以及将 Base64 字符串转换为 PNG 图像文件。
互动测验
开始使用 Django:构建组合应用
在本测验中,您将测试您对 Django(一个功能齐全的 Python Web 框架)的理解。通过完成此测验,您将重新审视创建功能齐全的 Web 应用程序的步骤,并了解 Django 的一些最重要的功能。
互动测验
开始使用 FastAPI
这个动手测验将测试您对 FastAPI 基础知识的了解,从安装和端点到自动 JSON 响应和 Swagger UI。
互动测验
获取器和设置器:在 Python 中管理属性
在本测验中,您将测试您对 Python 的 getter 和 setter 方法以及属性的理解。您将了解何时使用这些工具以及它们如何帮助维护类中的封装。
互动测验
Python 异步功能入门
在本测验中,您将测试您对 Python 异步编程的理解。您将重新审视同步和异步程序的概念,以及为什么您可能想要编写异步程序。您还将测试您有关如何使用 Python 异步功能的知识。
互动测验
Python IDLE 入门
在本测验中,您将测试您对 Python IDLE 的理解,Python IDLE 是每个 Python 安装附带的默认集成开发环境 (IDE)。您将重新审视如何在 IDLE 中直接与 Python 交互、编辑和执行 Python 文件。
互动测验
开始使用 Python 进行测试
在本测验中,您将测试您对 Python 测试的理解。有了这些知识,您将能够创建基本测试,执行它们,并在用户之前发现错误。
互动测验
Python 的 GitHub 操作
在本测验中,您将测试您对 Python 的 GitHub Actions 的理解。通过完成此测验,您将重新了解如何使用 GitHub Actions 和工作流程来自动执行 Python 项目的检查、测试和部署。
互动测验
如何构建 Python 脚本?
在本测验中,您将测试您对组织和构建 Python 脚本的理解。您将重新审视有关编写清晰、可维护且可执行的 Python 代码的最佳实践的关键概念。
互动测验
如何选择 Python 函数名称?
在本测验中,您将测试您对如何选择 Python 函数名称的理解。通过完成本测验,您将重新审视 Python 函数命名的规则和约定,以及为什么它们对于编写 Python 代码很重要。
互动测验
如何将Python添加到路径
测试您对 PATH 变量的了解,并了解如何在 Windows、Linux 和 macOS 上添加 Python 以方便终端访问。
互动测验
如何检查 Python 字符串是否包含子字符串
在本测验中,您将检查您对检查 Python 字符串是否包含子字符串的最佳方法的理解。您还将重新审视进一步检查子字符串的惯用方法,使用正则表达式将子字符串与条件进行匹配,以及在 pandas 中搜索子字符串。
互动测验
如何创建 Django 项目
检查您的 Django 设置技能。安全安装并确定需求,创建项目和应用程序。开始构建您的第一个网站。
互动测验
如何使用 pandas 创建数据透视表
本测验旨在进一步加深您对数据透视表的了解。通过阅读教程您无法找到所有答案,因此您需要自己进行一些调查。通过找到所有答案,您一定会学到一些其他有趣的东西。
互动测验
如何处理 Polars 中的缺失数据
此测验将测试您在 Polars 中处理空数据的知识。您不会在本教程中找到所有答案,因此您需要进行一些额外的调查。通过找到所有答案,您一定会学到一些有趣的东西。
互动测验
如何调试常见的 Python 错误
参加此测验来回顾核心 Python 调试技术,例如读取回溯、使用 print() 以及设置断点来查找和修复错误。
互动测验
如何在 pandas 中删除空值
对 pandas .dropna() 进行自我测试:删除空值、清理缺失数据并准备 DataFrame 进行准确分析。
互动测验
如何在 Python 中查找绝对值
在本测验中,您将测试您在 Python 中计算绝对值的知识,掌握内置函数和常见用例以提高编码准确性。
互动测验
如何在 Python 中展平列表列表
在本测验中,您将测试您对如何在 Python 中展平列表的理解。展平列表涉及将多维列表(例如矩阵)转换为一维列表。这是处理存储为嵌套列表的数据时的常见操作。
互动测验
如何使用 Polars .group_by() 对数据进行分组
测试您的 Polars .group_by() 和聚合技能。此测验超出了教程的范围,因此您需要更深入地挖掘才能找到所有答案。
互动测验
如何在系统上安装 Python:指南
在此测验中,您将测试您对如何在计算机上安装或更新 Python 的理解。有了这些知识,您将能够在各种操作系统上设置 Python,包括 Windows、macOS 和 Linux。
互动测验
如何在 Python 中连接字符串
测试您对 Python 的 .join() 字符串方法的理解,该方法用于组合字符串、处理边缘情况和优化性能。
互动测验
如何使用 pyproject.toml 管理 Python 项目
在本测验中,您将测试您对 Python 的 pyproject.toml 文件的理解,该文件通过统一包设置、管理依赖项和简化构建来简化 Python 项目配置。
互动测验
如何在 Python 中从列表中删除项目
在本测验中,您将测试您对从 Python 列表中删除项目的理解。这是Python编程的一项基本技能,掌握它将使你能够有效地操作列表。
互动测验
如何重置 pandas DataFrame 索引
本测验将挑战您在 pandas DataFrame 中重置索引的知识。您不会在本教程中找到所有答案,因此您需要进行一些额外的调查。通过找到所有答案,您一定会学到一些有趣的东西。
互动测验
如何运行 Python 脚本
作为 Python 开发人员需要培养的最重要技能之一是能够运行 Python 脚本和代码。测试您对运行代码的理解程度。
互动测验
如何在 Python 中分割字符串
在本测验中,您将测试您对 Python 的 .split() 方法的理解。此方法对于文本处理和数据解析任务非常有用,允许您根据指定的分隔符将字符串划分为子字符串列表。
互动测验
如何从 Python 字符串中删除字符
在本测验中,您将测试您对 Python 的 .strip()、.lstrip() 和 .rstrip() 方法以及 .removeprefix() 和 .removesuffix() 的理解。这些方法对于清理用户输入、标准化文件名和准备存储数据等任务非常有用。
互动测验
如何在 NumPy where() 中使用条件表达式
本测验旨在测试您对 np.where() 函数的理解。您无法在本教程中找到所有答案,因此您需要进行额外的研究。建议您在完成此测验之前确保可以完成教程中的所有练习。享受吧!
互动测验
如何在Python中使用生成器和yield
在本测验中,您将测试您对Python 生成器和yield 语句的理解。有了这些知识,您将能够以更 Python 的方式处理大型数据集、创建生成器函数和表达式以及构建数据管道。
互动测验
如何使用 Git:初学者指南
测试您对 Git 基础知识的了解:初始化存储库、暂存文件、提交快照以及管理项目历史记录。
互动测验
如何使用 Python:您的第一步
通过此测验回顾 Python 的基础知识。练习每个初学者都应该知道的语法、关键字、变量、错误和工具。
互动测验
如何在Python中使用sorted()和.sort()
在本测验中,您将测试您对使用 Sorted() 和 .sort() 在 Python 中进行排序的理解。您将重新审视如何对不同数据结构中的各种类型的数据进行排序、自定义顺序以及在 Python 中使用两种不同的排序方式。
互动测验
如何使用 Polars LazyFrames
本测验将挑战您使用 Polars LazyFrames 的知识。您不会在本教程中找到所有答案,因此您需要进行一些额外的调查。通过找到所有答案,您一定会学到一些有趣的东西。
互动测验
如何使用 PEP 8 编写漂亮的 Python 代码
在本测验中,您将测试您对 PEP 8 的理解,即 Python 增强提案,它提供了有关如何编写 Python 代码的指南和最佳实践。通过完成此测验,您将重新审视 PEP 8 中规定的关键准则以及如何设置开发环境以编写符合 PEP 8 的 Python 代码。
互动测验
如何用 Python 编写文档字符串
测试您对 Python 文档字符串的了解,包括语法、约定、格式以及如何访问和生成文档。
互动测验
拥抱脸部变形金刚
在本测验中,您将测试您对 Hugging Face Transformers 库的理解。该库是在自然语言处理任务、计算机视觉和其他机器学习应用程序中使用转换器模型的热门选择。
互动测验
在 Python 中实现接口
在本测验中,您将测试您对 Python 接口及其在软件工程中的作用的理解。您将了解接口如何帮助管理不断增长的应用程序中的复杂性以及如何在 Python 中实现它们。
互动测验
继承和组合:Python OOP 指南
在本测验中,您将测试您对 Python 中的继承和组合的理解。这是面向对象编程中的两个主要概念,有助于对两个类之间的关系进行建模。通过完成本测验,您将重新了解如何在 Python 中使用继承和组合、模型类层次结构以及使用多重继承。
互动测验
使用 pipx 安装并执行 Python 应用程序
在本测验中,您将测试您对如何使用 pipx 工具从隔离的虚拟环境运行 Python 应用程序的理解。有了这些知识,您将能够安全地运行在操作系统中全局安装的 Python 应用程序。
互动测验
与 Python 交互
测试您对 Python REPL、从文件运行脚本、使用 IDE 和代码编辑器以及 Jupyter Notebook 的了解。
互动测验
介绍 DuckDB
此测验将挑战您使用 DuckDB 的知识。您不会在本教程中找到所有答案,因此您需要进行一些额外的调查。通过找到所有答案,您一定会学到一些有趣的东西。
互动测验
Python 中的迭代器和可迭代对象:运行高效迭代
在本测验中,您将测试您对 Python 迭代器和可迭代对象的理解。通过完成此测验,您将重新审视如何创建和使用迭代器和可迭代对象、它们之间的差异,并回顾如何使用生成器函数。
互动测验
LangGraph:用 Python 构建有状态的 AI 代理
参加此测验来测试您对 LangGraph 的理解,LangGraph 是一个专为有状态、循环和多参与者大型语言模型 (LLM) 应用程序而设计的 Python 库。通过完成此测验,您将重新了解如何在 LangGraph 中构建 LLM 工作流程和代理。
互动测验
Python 中的线性回归
在本测验中,您将测试您对 Python 线性回归的了解。线性回归是基本的统计和机器学习技术之一,而 Python 是机器学习的热门选择。
互动测验
Python 中的列表与元组
通过此测验挑战自己,评估并加深您对 Python 列表和元组的理解。您将探索关键概念,例如如何创建、访问和操作这些数据类型,同时还将学习在代码中有效使用它们的最佳实践。
互动测验
使用 Python 登录
在本测验中,您将测试您对 Python 日志记录模块的理解。有了这些知识,您将能够向应用程序添加日志记录,这可以帮助您调试错误和分析性能。
互动测验
marimo:反应式、可复制的笔记本
此测验是巩固和巩固您所学的 marimo 笔记本知识的好方法。您将在本教程中找到大部分答案,但您需要做一些额外的研究才能找到一些答案。
互动测验
掌握 While 循环
使用 Python“while”循环练习无限迭代。立即测试您对 Python 循环、关键字和最佳实践的了解。
互动测验
Python Web 应用程序中的模型-视图-控制器 (MVC):用乐高进行解释
在本测验中,您将测试您对模型-视图-控制器 (MVC) 设计模式的理解,这是许多 Python Web 框架中的基本概念。通过完成此测验,您将重新审视模型、视图和控制器的概念,以及它们与具体 Web 开发示例的关系。
互动测验
使用 Ruff 进行现代 Python Linting
通过快速测验测试您的 Ruff 技能。练习安装检查、连续检查、格式化、规则选择、自动修复和配置。
互动测验
Python 中的命名空间和作用域
在本测验中,您将测试您对 Python 命名空间和变量范围的理解。这些概念对于组织分配给 Python 程序中对象的符号名称并确保它们不会相互干扰至关重要。
互动测验
Python 中的命名空间
在本测验中,您将测试您对 Python 命名空间的理解。这些概念对于组织分配给 Python 程序中对象的符号名称并确保它们不会相互干扰至关重要。
互动测验
Python 中的嵌套循环
嵌套循环允许您对多个序列执行重复操作,但是还有更多吗?测试您对 Python 中嵌套循环的理解!
互动测验
NumPy 实际示例:有用的技术
本测验将测试您对使用 NumPy 数组的理解。您不会在本教程中找到所有答案,因此您需要进行一些额外的调查。通过找到所有答案,您一定会学到一些有趣的东西。
互动测验
Python 中的运算符和表达式
测试您对 Python 中的运算符和表达式的理解,包括算术运算符、比较运算符、布尔运算符和恒等运算符。
互动测验
北极熊与熊猫:有什么区别?
参加此测验来测试您对 Polars 与 pandas 教程的了解,并查看这些开源 Python 库之间的主要区别。
互动测验
实用即时工程
在此测验中,您将测试您对 GPT-3.5 和 GPT-4 等大型语言模型 (LLM) 的即时工程技术的理解。您将重新审视如何使用 OpenAI 的 API,将即时工程技术应用于实际示例,并使用各种策略来改进您的结果。
互动测验
Jinja 模板入门
在本测验中,您将测试您对 Jinja 模板的理解。 Jinja 是一个强大的工具,用于在 Python Web 应用程序中构建丰富的模板,它还可以用于创建具有编程内容的文本文件。
互动测验
Python 装饰器入门
在本测验中,您将重新审视 Python 装饰器的基本概念以及如何创建和使用它们。
互动测验
Python 性能分析
测试您对 Python 分析和性能工具的了解。练习识别瓶颈并使用 cProfile 和 timeit 等分析器。
互动测验
Pydantic:简化 Python 中的数据验证
在本测验中,您将测试您对 Pydantic(一个强大的 Python 数据验证库)的理解。您将重新审视一些概念,例如使用数据模式、编写自定义验证器、验证函数参数以及使用 pydantic-settings 管理设置。
互动测验
Python 3.13:供您尝试的炫酷新功能
在本测验中,您将测试您对 Python 3.13 中引入的新功能的理解。通过完成此测验,您将了解此版本的 Python 中的关键更新和改进。
互动测验
Python 3.13:自由线程和 JIT 编译器
在本测验中,您将测试您对 Python 3.13 中新功能的理解。您将重新审视如何编译自定义 Python 版本、禁用全局解释器锁 (GIL)、启用即时 (JIT) 编译器等等。
互动测验
Python 3.14:供您尝试的酷炫新功能
在本测验中,您将测试您对 Python 3.14 中引入的新功能的理解。通过完成此测验,您将了解此版本的 Python 中的关键更新和改进。
互动测验
Python 和 REST API:与 Web 服务交互
在此测验中,您将测试您对 REST API 的理解以及如何使用 Python 与它们交互。有了这些知识,您将能够检索、解析、更新和操作您感兴趣的任何 RESTful API 提供的数据。
互动测验
Python 注释
测试您对注释和类型提示的了解,包括不同的 Python 版本如何在运行时评估它们。
互动测验
Python args 和 kwargs:揭秘
在本测验中,您将测试您对如何在 Python 中使用 *args 和 **kwargs 的理解。有了这些知识,您将能够为您的职能添加更多灵活性。
互动测验
Python 基础知识:使用类构建系统
您可以使用类在 Python 中构建复杂的系统。通过组合类、从其他类继承以及重写类行为,您将利用面向对象编程 (OOP) 的强大功能。
互动测验
Python 基础知识:条件逻辑和控制流
使用条件逻辑,您可以编写根据不同条件执行不同操作的程序。与函数和循环配合使用,条件逻辑允许您编写可以处理许多不同情况的复杂程序。
互动测验
Python 基础知识:字典
Python 字典与列表和元组一样,存储对象的集合。但是,字典不是按序列存储对象,而是以称为键值对的数据对形式保存信息。
互动测验
Python 基础知识:文件系统操作
pathlib 模块允许您使用 Python 执行文件路径操作。这些操作包括创建、迭代、搜索、移动和删除文件和文件夹。
互动测验
Python 基础知识:查找和修复代码错误
当原本有效的程序没有执行预期的操作时,就会出现逻辑错误。它们会导致称为错误的意外行为。消除错误称为调试,调试器是一种可以帮助您查找错误并了解其发生原因的工具。
互动测验
Python 基础知识:函数和循环
函数将代码分解成更小的块,非常适合定义程序将在代码中多次执行的操作。程序需要执行相同的任务时,不必每次都编写相同的代码,只需调用该函数即可!
互动测验
Python 基础知识:使用 pip 安装软件包
尽管 Python 因附带电池而闻名,但您仍然会不时发现自己需要第三方库。您可以使用 pip 安装此类软件包。
互动测验
Python 基础知识:列表和元组
测试您对 Python 列表和元组的了解,包括创建、索引、切片、可变性和嵌套。
互动测验
Python 基础知识:模块和包
您可以通过将相关代码放入称为模块的单独文件中来构建应用程序。然后,您可以使用 import 语句来使用另一个文件中的模块。
互动测验
Python 基础知识:数字和数学
您不需要成为数学高手才能很好地编程,但数字是任何编程语言不可或缺的一部分。 Python 也不例外。
互动测验
Python 基础知识:面向对象编程
OOP(即面向对象编程)是一种通过将相关属性和行为捆绑到单个对象中来构建程序的方法。在本测验中,您将测试您对 OOP 的理解。
互动测验
Python 基础知识:读写文件
通过读取和写入文件,您可以在 Python 程序和外部软件之间来回移动数据。 CSV 文件格式特别有用,因为它是传输表格数据最广泛支持的文件格式之一。
互动测验
Python 基础知识:范围
要完全理解 Python 中的函数和循环,您需要熟悉作用域问题,它决定名称在程序中的可见位置。
互动测验
Python 基础知识:设置 Python
通过此快速测验测试您在 Windows、macOS 和 Ubuntu 上安装 Python、设置 PATH 以及使用 IDLE 的知识。
互动测验
Python 基础知识:字符串和字符串方法
字符串是 Python 中的基本数据类型。简而言之,字符串是文本的集合,它们出现在许多上下文中。例如,字符串可以来自用户输入、从文件读取的数据或通过网络通信的设备发送的消息。
互动测验
Python 字节
在本测验中,您将测试您对 Python 字节对象的理解。通过完成此测验,您将重新审视与这种低级数据类型相关的关键概念。
互动测验
Python 闭包:常见用例和示例
在本测验中,您将测试您对 Python 闭包的理解。闭包是函数式编程语言中的一个常见功能,在 Python 中特别流行,因为它们允许您创建基于函数的装饰器。
互动测验
Python 代码质量:最佳实践和工具
在本测验中,您将测试您对 Python 代码质量、工具和最佳实践的理解。通过完成此测验,您将重新审视生成功能性、可读性、可维护性、高效性和安全性的高质量 Python 代码的重要性。
互动测验
Python 并发
在本测验中,您将测试您对 Python 并发性的理解。您将重新审视 Python 中不同形式的并发、如何为 I/O 密集型任务实现多线程和异步解决方案,以及如何为 CPU 密集型任务实现真正的并行性。
互动测验
Python 装饰器 101
Work through this quiz to review first-class functions, inner functions, and decorators, and learn how to use them to extend behavior cleanly in Python.
互动测验
Python Descriptors:An Introduction
Learn how Python descriptors control attribute access, use special methods for getting and setting values, and implement read-only attributes.
互动测验
Python Dictionary Comprehensions:How and When to Use Them
In this quiz, you'll test your understanding of Python dictionary comprehensions. Dictionary comprehensions are a concise and quick way to create, transform, and filter dictionaries in Python, and can significantly enhance your code's conciseness and readability.
互动测验
Python Dictionary Iteration
Dictionaries are one of the most important and useful data structures in Python. Learning how to iterate through a Dictionary can help you solve a wide variety of programming problems in an efficient way. Test your understanding on how you can use them better!
互动测验
Python Exceptions:An Introduction
In this quiz, you'll test your understanding of Python exceptions. You'll cover the difference between syntax errors and exceptions and learn how to raise exceptions, make assertions, and use the try and except block.
互动测验
Python Folium:Create Web Maps From Your Data
Python’s Folium library gives you access to the mapping strengths of the Leaflet JavaScript library through a Python API. It allows you to create interactive geographic visualizations that you can share as a website.
互动测验
Python for Loops:The Pythonic Way
In this quiz, you'll test your understanding of Python's for loop. You'll revisit how to iterate over items in a data collection, how to use range() for a predefined number of iterations, and how to use enumerate() for index-based iteration.
互动测验
Python GUI Programming With Tkinter
In this quiz, you'll test your understanding of Python GUI Programming With Tkinter, the de facto Python GUI framework. Check your knowledge of GUI programming concepts such as widgets, geometry managers, and event handlers.
互动测验
Python import:Advanced Techniques and Tips
In this quiz, you'll test your understanding of Python's import statement and how it works. You'll revisit how to use modules and import them dynamically at runtime.
互动测验
Python Keywords:An Introduction
In this quiz, you'll test your understanding of Python keywords and soft keywords. These reserved words have specific functions and restrictions in Python, and understanding how to use them correctly is fundamental for building Python programs.
互动测验
Python Lambda Functions
Python lambdas are little, anonymous functions, subject to a more restrictive but more concise syntax than regular Python functions. Test your understanding on how you can use them better!
互动测验
Python Mappings
In this quiz, you'll test your understanding of the basic characteristics and operations of Python mappings. By working through this quiz, you'll revisit the key concepts and techniques of creating a custom mapping.
互动测验
Python Modules and Packages
In this quiz, you'll test your understanding of Python modules and packages, which are mechanisms that facilitate modular programming. Modular programming involves breaking a large programming task into smaller, more manageable subtasks or modules. This approach has several advantages, including simplicity, maintainability, and reusability.
互动测验
Python Name-Main Idiom
Test your knowledge of Python's if __name__ =="__main__" idiom by answering a series of questions! You've probably encountered the name-main idiom and might have even used it in your own scripts. But did you use it correctly?
互动测验
Python Namespace Packages
Practice your knowledge about namespace packages in Python. Revisit managing multiple packages without an __init__.py file.
互动测验
Python Project Management With uv
Test your skills with uv, the fast Python project manager. Practice setup, package installs, and key files created by uv.
互动测验
Python Raw Strings
In this quiz, you can practice your understanding of how to use raw string literals in Python. With this knowledge, you'll be able to write cleaner and more readable regular expressions, Windows file paths, and many other string literals that deal with escape character sequences.
互动测验
Python's Built-in Exceptions:A Walkthrough With Examples
In this quiz, you'll test your understanding of Python's built-in exceptions. With this knowledge, you'll be able to effectively identify and handle these exceptions when they appear. Additionally, you'll be more familiar with how to raise some of these exceptions in your code.
互动测验
Python's Built-in Functions:A Complete Exploration
Take this quiz to test your knowledge about the available built-in functions in Python. By taking this quiz, you'll deepen your understanding of how to use these functions and the common programming problems they cover, from mathematical computations to Python-specific features.
互动测验
Python's Bytearray
In this quiz, you'll test your understanding of Python's bytearray data type. By working through this quiz, you'll revisit the key concepts and uses of bytearray in Python.
互动测验
Python's enumerate()
Once you learn about for loops in Python, you know that using an index to access items in a sequence isn't very Pythonic. So what do you do when you need that index value? In this tutorial, you'll learn all about Python's built-in enumerate(), where it's used, and how you can emulate its behavior.
互动测验
Python Sequences:A Comprehensive Guide
In this quiz, you'll test your understanding of sequences in Python. You'll revisit the basic characteristics of a sequence, operations common to most sequences, special methods associated with sequences, and how to create user-defined mutable and immutable sequences.
互动测验
Python Set Comprehensions:How and When to Use Them
In this quiz, you'll test your understanding of Python set comprehensions. Set comprehensions are a concise and quick way to create, transform, and filter sets in Python. They can significantly enhance your code's conciseness and readability compared to using regular for loops to process your sets.
互动测验
Python Sets
In this quiz, you'll assess your understanding of Python's built-in set data type. You'll revisit the definition of unordered, unique, hashable collections, how to create and initialize sets, and key set operations.
互动测验
Python's Instance, Class, and Static Methods Demystified
In this quiz, you'll test your understanding of instance, class, and static methods in Python. By working through this quiz, you'll revisit the differences between these methods and how to use them effectively in your Python code.
互动测验
Python Skill Test
通过包含基础到高级问题的技能测验来测试您的 Python 知识。您是新手、中级、熟练还是专家?
互动测验
Python's property():Add Managed Attributes to Your Classes
In this quiz, you'll test your understanding of Python's property(). With this knowledge, you'll be able to create managed attributes in your classes, perform lazy attribute evaluation, provide computed attributes, and more.
互动测验
Python's raise:Effectively Raising Exceptions in Your Code
In this quiz, you'll test your understanding of how to raise exceptions in Python using the raise statement. This knowledge will help you handle errors and exceptional situations in your code, leading to more robust programs and higher-quality code.
互动测验
Python's Requests Library
Test your understanding of the Python Requests library for making HTTP requests and interacting with web services.
互动测验
Python String Formatting:Available Tools and Their Features
You can take this quiz to test your understanding of the available tools for string formatting in Python, as well as their strengths and weaknesses. These tools include f-strings, the .format() method, and the modulo operator.
互动测验
Python Strings and Character Data
This quiz will test your understanding of Python's string data type and your knowledge about manipulating textual data with string objects. You'll cover the basics of creating strings using literals and the str() function, applying string methods, using operators and built-in functions, and more!
互动测验
Python String Splitting
Practice Python string splitting, from whitespace handling to using custom separators and regex. Review split(), rsplit(), and edge cases.
互动测验
Python's unittest:Writing Unit Tests for Your Code
In this quiz, you'll test your understanding of Python testing with the unittest framework from the standard library. With this knowledge, you'll be able to create basic tests, execute them, and find bugs before your users do.
互动测验
Python Textual:Build Beautiful UIs in the Terminal
In this quiz, you'll test your understanding of the Python Textual library. This library is used to create rich terminal applications and widgets. By working through this quiz, you'll reinforce your knowledge of Textual's key concepts and features.
互动测验
Python Threading
This is a quiz that will review topics covered in our An Intro To Threading tutorial.
互动测验
Python Thread Safety:Using a Lock and Other Techniques
In this quiz, you'll test your understanding of Python thread safety. You'll revisit the concepts of race conditions, locks, and other synchronization primitives in the threading module. By working through this quiz, you'll reinforce your knowledge about how to make your Python code thread-safe.
互动测验
Python time.sleep()
In this quiz, you'll revisit how to add time delays to your Python programs.
互动测验
Python Type Checking
In this quiz, you'll test your understanding of Python type checking. You'll revisit concepts such as type annotations, type hints, adding static types to code, running a static type checker, and enforcing types at runtime. This knowledge will help you develop your code more efficiently.
互动测验
Python Virtual Environments:A Primer
In this quiz, you'll test your understanding of Python virtual environments. With this knowledge, you'll be able to avoid dependency conflicts and help other developers reproduce your development environment.
互动测验
Python while Loops:Repeating Tasks Conditionally
In this quiz, you'll test your understanding of Python's while loop. This loop allows you to execute a block of code repeatedly as long as a given condition remains true. Understanding how to use while loops effectively is a crucial skill for any Python developer.
互动测验
Quantum Computing Basics With Qiskit
Test your understanding of quantum computing basics, including superposition, qubits, entanglement, and key programming concepts.
互动测验
Reading and Writing WAV Files in Python
In this quiz, you can test your knowledge of handling WAV audio files in Python with the wave module. By applying what you've learned, you'll demonstrate your ability to synthesize sounds, analyze and visualize waveforms, create dynamic spectrograms, and enhance audio with special effects.
互动测验
Recursion in Python:An Introduction
Test your understanding of recursion in Python, including base cases, recursive structure, performance considerations, and common use cases.
互动测验
Ruff:A Modern Python Linter
In this quiz, you'll test your understanding of Ruff, a modern linter for Python. By working through this quiz, you'll revisit why you'd want to use Ruff to check your Python code and how it automatically fixes errors, formats your code, and provides optional configurations to enhance your linting.
互动测验
Shallow vs Deep Copying of Python Objects
In this quiz, you'll test your understanding of Python's copy module, which provides tools for creating shallow and deep copies of objects. This knowledge is crucial for managing complex, mutable data structures safely and effectively.
互动测验
Single and Double Underscores in Python Names
In this quiz, you'll test your understanding of the use of single and double underscores in Python names. This knowledge will help you differentiate between public and non-public names, avoid name clashes, and write code that looks Pythonic and consistent.
互动测验
Socket Programming in Python
In this quiz, you'll test your understanding of Python sockets. With this knowledge, you'll be able to create your own client-server applications, handle multiple connections simultaneously, and send messages and data between endpoints.
互动测验
Speed Up Python With Concurrency
Test your Python concurrency knowledge:CPU vs I/O-bound tasks, GIL, asyncio, race conditions, and multiprocessing.
互动测验
String Interpolation in Python:Exploring Available Tools
Take this quiz to test your understanding of the available tools for string interpolation in Python, as well as their strengths and weaknesses. These tools include f-strings, the .format() method, and the modulo operator.
互动测验
Strip Characters From a Python String
Test your Python skills on removing characters from strings using strip, lstrip, and rstrip. Practice default behavior, custom chars, and more.
互动测验
Structural Pattern Matching
In this quiz, you'll test your understanding of structural pattern matching in Python. This powerful control flow construct, introduced in Python 3.10, offers concise and readable syntax while promoting a declarative code style.
互动测验
Supercharge Your Classes With Python super()
In this quiz, you'll test your understanding of inheritance and the super() function in Python. By working through this quiz, you'll revisit the concept of inheritance, multiple inheritance, and how the super() function works in both single and multiple inheritance scenarios.
互动测验
The Python calendar Module
In this quiz, you'll test your understanding of the calendar module in Python. It'll evaluate your proficiency in manipulating, customizing, and displaying calendars directly within your terminal. By working through this quiz, you'll revisit the fundamental functions and methods provided by the calendar module.
互动测验
The Python print() Function
In this interactive quiz, you can revisit what you know about Python's print() function. You'll also get to quiz yourself about some of its lesser-known features.
互动测验
The Python print() Function
In this quiz, you'll test your understanding of Python's built-in print() function, covering how to format output, specify custom separators, and more.
互动测验
The Python return Statement
In this quiz, you can practice your understanding of how to use the Python return statement when writing functions. Additionally, you'll cover some good programming practices related to the use of return. With this knowledge, you'll be able to write readable, robust, and maintainable functions in Python.
互动测验
The Python Standard REPL:Try Out Code and Ideas Quickly
Test your understanding of the Python standard REPL. The Python REPL allows you to run Python code interactively, which is useful for testing new ideas, exploring libraries, refactoring and debugging code, and trying out examples.
互动测验
The Walrus Operator:Python's Assignment Expressions
In this quiz, you'll test your understanding of Python's walrus operator. This operator was introduced in Python 3.8, and understanding it can help you write more concise and efficient code.
互动测验
Threading in Python
Test your understanding of Python threading, including how to create threads, use locks, avoid race conditions, and build pipelines.
互动测验
Understanding the Python Mock Object Library
In this quiz, you'll test your understanding of Python's unittest.mock library. With this knowledge, you'll be able to write robust tests, create mock objects, and ensure your code is reliable and efficient.
互动测验
Using and Creating Global Variables in Your Python Functions
In this quiz, you'll test your understanding of how to use global variables in Python functions. With this knowledge, you'll be able to share data across an entire program, modify and create global variables within functions, and understand when to avoid using global variables.
互动测验
Using Data Classes in Python
Test your knowledge of Python data classes, namedtuple, immutability, auto-generated methods, inheritance, and slots.
互动测验
Using Dictionaries in Python
Revisit Python's dictionary data type in this quick quiz. How does it work, why is it useful, and how is it different from a list?
互动测验
Using Jupyter Notebooks
Test your Jupyter Notebook skills:cells, modes, shortcuts, Markdown, server tools, and exporting notebooks to HTML.
互动测验
Using Python's .__dict__ to Work With Attributes
In this quiz, you'll test your understanding of Python's .__dict__ attribute and its usage in classes, instances, and functions. Acting as a namespace, this attribute maps attribute names to their corresponding values and serves as a versatile tool for metaprogramming and debugging.
互动测验
Using .__repr__() vs .__str__() in Python
In this quiz, you'll test your understanding of Python's dunder repr and dunder str special methods. These methods allow you to control how a program displays an object, making your classes more readable and easier to debug and maintain.
互动测验
Web Automation With Python and Selenium
In this quiz, you'll test your understanding of using Selenium with Python for web automation. You'll revisit concepts like launching browsers, interacting with web elements, handling dynamic content, and implementing the Page Object Model (POM) design pattern.
互动测验
Web Scraping With Scrapy and MongoDB
In this quiz, you'll test your understanding of web scraping with Scrapy and MongoDB. You'll revisit how to set up a Scrapy project, build a functional web scraper, extract data from websites, store scraped data in MongoDB, and test and debug your Scrapy web scraper.
互动测验
Welcome to Real Python!
Get a tour of Real Python, find resources for your skill level, and learn how to use the community to study effectively.
互动测验
What Are CRUD Operations?
In this quiz, you'll revisit the key concepts and techniques related to CRUD operations. These operations are fundamental to any system that interacts with a database, and understanding them is crucial for effective data management.
互动测验
What Are Mixin Classes in Python?
Test your knowledge of Python mixins—specialized classes that let you reuse methods without traditional inheritance.
互动测验
What Can I Do With Python?
Test your knowledge of what Python can and can't do, from web and GUI apps to data science, CLI tools, and embedded systems.
互动测验
What Can You Do With Python?
Review where Python shines:web, APIs, CLIs, GUIs, data science, ORMs, automation, and robots. Practice key terms, tools, and workflows.
互动测验
What Exactly Is the Zen of Python?
Learn and test the Zen of Python, its guiding aphorisms, and tips for writing clearer, more readable, and maintainable code.
互动测验
What Is Python's __init__.py For?
Test your understanding of Python's __init__.py files to master how they shape your packages, enhance project structure, and keep your code clean.
互动测验
What Is the __pycache__ Folder in Python?
In this quiz, you'll have the opportunity to test your knowledge of the __pycache__ folder, including when, where, and why Python creates these folders.
互动测验
What's Lazy Evaluation in Python?
In this quiz, you'll test your understanding of the differences between lazy and eager evaluation in Python. By working through this quiz, you'll revisit how Python optimizes memory use and computational overhead by deciding when to compute values.
互动测验
When to Use a List Comprehension in Python
In this quiz, you'll test your understanding of Python list comprehensions. You'll revisit how to rewrite loops as list comprehensions, how to choose between comprehensions and loops, and how to use conditional logic in your comprehensions.
互动测验
Working With Files in Python
Practice handling files and directories in Python, including opening, iterating, filtering, creating, deleting, copying, and renaming.
互动测验
Working With JSON Data in Python
In this quiz, you'll test your understanding of working with JSON in Python. By working through this quiz, you'll revisit key concepts related to JSON data manipulation and handling in Python.
Got feedback on our quizzes?
Python
- Python 输入、输出和导入
- 使用 Urllib.Request 和 urlopen() 的 Python Internet 访问
- Python 集
- Python 对象和类
- Python XML Parser 教程:读取 xml 文件示例(Minidom、ElementTree)
- 在 Python 中复制文件:shutil.copy()、shutil.copystat() 方法
- Python 2 与 Python 3:Python 2.x 和 Python 3.x 有什么区别?
- 加入 Real Python:创建您的帐户并访问高级 Python 教程
- Python if...else 语句
- Python - 数字
- Python 正则表达式:re.match()、re.search()、re.findall() 和示例
- Python 包