Python 教程

Python主页 Python简介 Python入门 Python语法 Python注释 Python变量 Python数据类型 Python数字 Python转换 Python字符串 Python布尔值 Python运算子 Python列表 Python元组 Python集 Python字典 Python If...Else Python While循环 Python的循环 Python函数 Python Lambda Python数组 Python类/对象 Python继承 Python迭代器 Python范围 Python模块 Python日期 Python数学 Python JSON Python正则表达式 Python PIP Python Try...Except Python用户输入 Python字符串格式


Python 文件处理 Python读取文件 Python写入/创建文件 Python删除文件

Python NumPy

NumPy简介 NumPy入门 NumPy创建数组 NumPy数组索引 NumPy数组切片 NumPy数据类型 NumPy复制与视图 NumPy阵列形状 NumPy数组重塑 NumPy数组迭代 NumPy数组连接 NumPy数组拆分 NumPy数组搜索 NumPy数组排序 NumPy数组过滤器 NumPy随机 NumPy ufunc


入门 平均中位数模式 标准偏差 百分位 资料分配 Normal 资料分配 散点图 线性回归 多项式回归 多重回归 规模 训练/测试 决策树

Python MySQL

MySQL入门 MySQL创建数据库 MySQL创建表 MySQL输入sert MySQL选择 MySQL位置 MySQL排序依据 MySQL删除 MySQL删除表 MySQL更新 MySQL限制 MySQL连接

Python MongoDB

MongoDB入门 MongoDB创建数据库 MongoDB创建集合 MongoDB插入 MongoDB查找 MongoDB查询 MongoDB排序 MongoDB删除 MongoDB Drop集合 MongoDB更新 MongoDB限制


Python概述 Python内置函数 Python字符串方法 Python列表方法 Python字典方法 Python元组方法 Python Set方法 Python文件方法 Python关键字 Python异常 Python词汇表

Module 参考

随机模块 请求模块 数学模块 c数学模块


删除列表重复项 反转字符串 ADD 两个数字

Python 示例

Python 示例 Python编译器 Python 练习 Python 测试 Python 证书

Python Tutorial

Python is a programming language.

Python can be used on a server to create web applications.

Start learning Python now »

Learning by 示例

With our "来试试吧" editor, you can edit Python code and view the result.


print("Hello, World!")
来试试吧 »

Click on the "来试试吧" button to see how it works.

Python 文件处理

In our 文件处理 section you will learn how to open, read, write, and delete files.

Python 文件处理

Python Database Handling

In our database section you will learn how to access and work with MySQL and MongoDB databases:

Python MySQL Tutorial

Python MongoDB Tutorial

Python 练习

Test Yourself With 练习


Insert the missing part of the code below to output "Hello World".

("Hello World")

Start the Exercise

Python 示例

Learn by examples! This tutorial supplements all explanations with clarifying examples.

See All Python 示例

Python 测试

Test your Python skills with a quiz.

Python 测试


You will also find complete function and method references:

参考 Overview

Built-in Functions

String Methods

List/Array Methods

Dictionary Methods

Tuple Methods

Set Methods

File Methods








Download Python

Download Python from the official Python web site:

Python Exam - Get Your Diploma!

W3Schools Certification

W3Schools' Online Certification

The perfect solution for professionals who need to balance work, family, and career building.

More than 25 000 certificates already issued!

Get Your 证书 »

The HTML证书 documents your knowledge of HTML.

The CSS证书 documents your knowledge of advanced CSS.

The JavaScript 证书 documents your knowledge of JavaScript and HTML DOM.

The Python 证书 documents your knowledge of Python.

The jQuery证书 documents your knowledge of jQuery.

The SQL证书 documents your knowledge of SQL.

The PHP 证书 documents your knowledge of PHP and MySQL.

The XML 证书 documents your knowledge of XML, XML DOM and XSLT.

The Bootstrap 证书 documents your knowledge of the Bootstrap framework.

W3Schools is optimized for learning, testing, and training. 示例 might be simplified to improve reading and basic understanding. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 1999-2020 by Refsnes Data. All Rights Reserved.
Powered by W3.CSS.