Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 00dce99

Browse files
committed
更新 数字
1 parent cc21120 commit 00dce99

File tree

1 file changed

+44
-4
lines changed

1 file changed

+44
-4
lines changed

‎Learning Python/2、类型和运算/2. 数字.ipynb

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@
274274
"**X / Y** \n",
275275
"真除法,无论任何类型都会保持小数部分。 \n",
276276
"**X // Y** \n",
277-
"Floor 除法,不考虑操作对象的类型,总会省略掉结果的小数部分"
277+
"Floor 除法,不考虑操作对象的类型,运算结果总是向负无穷的方向舍入"
278278
]
279279
},
280280
{
@@ -428,6 +428,46 @@
428428
"(2 + 1j) * 3"
429429
]
430430
},
431+
{
432+
"cell_type": "code",
433+
"execution_count": 1,
434+
"metadata": {},
435+
"outputs": [
436+
{
437+
"data": {
438+
"text/plain": [
439+
"(1+2j)"
440+
]
441+
},
442+
"execution_count": 1,
443+
"metadata": {},
444+
"output_type": "execute_result"
445+
}
446+
],
447+
"source": [
448+
"complex('1+2j') # 将字符串或数字转换成复数,字符串 + - 周围不能有空格"
449+
]
450+
},
451+
{
452+
"cell_type": "code",
453+
"execution_count": 3,
454+
"metadata": {},
455+
"outputs": [
456+
{
457+
"data": {
458+
"text/plain": [
459+
"(1+0j)"
460+
]
461+
},
462+
"execution_count": 3,
463+
"metadata": {},
464+
"output_type": "execute_result"
465+
}
466+
],
467+
"source": [
468+
"complex(1)"
469+
]
470+
},
431471
{
432472
"cell_type": "markdown",
433473
"metadata": {},
@@ -994,7 +1034,7 @@
9941034
"cell_type": "markdown",
9951035
"metadata": {},
9961036
"source": [
997-
"使用小数对象,结果能够改正(接受参数为字符串)"
1037+
"使用小数对象,结果能够改正,参数可以是整数,字符串,元组,float,或另一个 Decimal 对象。"
9981038
]
9991039
},
10001040
{
@@ -1309,7 +1349,7 @@
13091349
"## 3.3 集合(Set)\n",
13101350
"集合是一些唯一的、不可变的对象的一个无序集合,这些对象支持与数学集合理论相对应的操作。 \n",
13111351
"\n",
1312-
"要创建一个集合对象,需要向内置的set函数传递一个序列或其他的可迭代的对象"
1352+
"要创建一个集合对象,需要向内置的 set 函数传递一个序列或其他的可迭代的对象"
13131353
]
13141354
},
13151355
{
@@ -1826,7 +1866,7 @@
18261866
"name": "python",
18271867
"nbconvert_exporter": "python",
18281868
"pygments_lexer": "ipython3",
1829-
"version": "3.6.5"
1869+
"version": "3.7.3"
18301870
}
18311871
},
18321872
"nbformat": 4,

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /