布尔操作,是或者否:
|
if x is false, then y, else x |
(1) |
|
if x is false, then x, else y |
(2) |
|
if x is false, then |
(3)
|
比较操作,大还是小,是否相同对象,是否相同值:
|
strictly less than |
|
less than or equal |
|
strictly greater than |
|
greater than or equal |
|
equal |
|
not equal |
|
object identity |
|
negated object identity
|
常用数学计算:
|
sum of x and y |
||
|
difference of x and y |
||
|
product of x and y |
||
|
quotient of x and y |
||
|
floored quotient of x and y |
(1) |
|
|
remainder of |
(2) |
|
|
x negated |
||
|
x unchanged |
||
|
absolute value or magnitude of x |
||
|
x converted to integer |
(3)(6) |
|
|
x converted to floating point |
(4)(6) |
|
|
a complex number with real part re, imaginary part im. im defaults to zero. |
(6) |
|
|
conjugate of the complex number c |
||
|
the pair |
(2) |
|
|
x to the power y |
(5) |
|
|
x to the power y |
(5)
|
字符串常见操作:
|
|
(1) |
|
|
(1) |
|
the concatenation of s and t |
(6)(7) |
|
equivalent to adding s to itself n times |
(2)(7) |
|
ith item of s, origin 0 |
(3) |
|
slice of s from i to j |
(3)(4) |
|
slice of s from i to j with step k |
(3)(5) |
|
length of s |
|
|
smallest item of s |
|
|
largest item of s |
|
|
index of the first occurrence of x in s (at or after index i and before index j) |
(8) |
|
total number of occurrences of x in s
|
数组常见操作:
|
item i of s is replaced by x |
|
|
slice of s from i to j is replaced by the contents of the iterable t |
|
|
same as |
|
|
the elements of |
(1) |
|
removes the elements of |
|
|
appends x to the end of the sequence (same as |
|
|
removes all items from s (same as |
(5) |
|
creates a shallow copy of s (same as |
(5) |
|
extends s with the contents of t (for the most part the same as |
|
|
updates s with its contents repeated n times |
(6) |
|
inserts x into s at the index given by i(same as |
|
|
retrieves the item at i and also removes it from s |
(2) |
|
remove the first item from s where |
(3) |
|
reverses the items of s in place |
(4)
|
常见格式化占位符:
|
Signed integer decimal. |
|
|
Signed integer decimal. |
|
|
Signed octal value. |
(1) |
|
Obsolete type – it is identical to |
(6) |
|
Signed hexadecimal (lowercase). |
(2) |
|
Signed hexadecimal (uppercase). |
(2) |
|
Floating point exponential format (lowercase). |
(3) |
|
Floating point exponential format (uppercase). |
(3) |
|
Floating point decimal format. |
(3) |
|
Floating point decimal format. |
(3) |
|
Floating point format. Uses lowercase exponential format if exponent is less than -4 or not less than precision, decimal format otherwise. |
(4) |
|
Floating point format. Uses uppercase exponential format if exponent is less than -4 or not less than precision, decimal format otherwise. |
(4) |
|
Single character (accepts integer or single character string). |
|
|
String (converts any Python object using |
(5) |
|
String (converts any Python object using |
(5) |
|
String (converts any Python object using |
(5) |
|
No argument is converted, results in a |
相关推荐
Python操作常见Office软件.zip - Python 操作 Excel、Word、Pdf 等。Python操作常见Office软件.zip - Python 操作 Excel、Word、Pdf 等。Python操作常见Office软件.zip - Python 操作 Excel、Word、Pdf 等。Python...
python的一些字符串的不常见操作哦!相信大家都用惯了那些常见的字符串操作,想学一些不常见,但是有可能用得到的操作吧!看这里,你值得拥有
Python经典面试题 Python常见面试考试题目整理总结 Python面试题手册 1:Python 如何实现单例模式? 2:什么是 lambda 函数? 3:Python 是如何进行类型转换的? 4:Python 如何定义一个函数 5:Python 是如何进行...
本资源为opencv-python的python文件,主要包含常用的opencv-python的相关操作,可以用于初学者的学习以及快速进行开发。
这是DS小龙哥编写整理的,Python3入门指南.pdf,总共10章,可以当做入门书籍、平时的参考书籍,文中代码都可以复制粘贴。后续资源包会持续更新。 这是书籍的目录 编辑: DS小龙哥 1 Python3入门指南 1 一、 Python...
内容概要:python常见的文件和文件夹操作 目标人群:具有一定python编程基础的人群 使用场景:Python3 功能介绍:显示当前工作目录下的所有文件名和文件夹名、显示当前工作目录下的所有文件的大小总和等。
pythonnumpy教程_PythonNumpy库常见⽤法⼊门教程 本⽂实例讲述了Python Numpy库常见⽤法。分享给⼤家供⼤家参考,具体如下: 1、简介 Numpy是⼀个常⽤的Python科学技术库,通过它可以快速对数组进⾏操作,包括形状...
我们将介绍Python 程 序员要面对的常见的任务。这些任务分为 —— 数据结构操作,文件操作等等。
本教程包含了100个常见的Python面试题,涵盖Python基础知识、高级特性、网络编程、数据库操作、数据结构和算法等多个方面。每个问题都提供了详细的解析,帮助面试者更好地准备Python面试。 适用人群: 本教程适合...
python常见字符换的操作技巧,适合初学者学习
Python常见面试题精讲,请诸位认真操作,预祝诸位顺利通过
本文实例讲述了Python Numpy库常见用法。分享给大家供大家参考,具体如下: 1、简介 Numpy是一个常用的Python科学技术库,通过它可以快速对数组进行操作,包括形状操作、排序、选择、输入输出、离散傅立叶变换、基本...
主要介绍了Python元组常见操作,结合实例形式分析了Python元组的概念、功能、常见定义、获取、遍历等相关操作技巧与注意事项,需要的朋友可以参考下
Python
python常见数据类型 Python是一种高级编程语言,它支持多种数据类型,包括数字、字符串、列表、元组、字典和集合。在本文中,我们将介绍这些常见的Python数据类型。 数字 Python支持三种数字类型:整数、浮点数和...
主要介绍了Python文件常见操作,结合实例形式分析Python针对文件的读写、遍历等相关操作技巧,需要的朋友可以参考下
现在,我们已学习了Python 的语法,它的基本的数据类型,和很多我们喜欢的 Python 的库函数。本章假设你至少理解了这门语言的所有基本成分,并且除了 ...这些任务分为—— 数据结构操作,文件操作等等。
在常见操作系统上安装 Python 的简单教程