Update 4.ipynb

This commit is contained in:
xixu-me committed 2024-05-04 19:03:49 +08:00
1 parent b02cd70ac3
commit 06ff05090b
1 file changed
+59 -10
+59 -10
View File
@@ -2,27 +2,51 @@
"cells": [
{
"cell_type": "code",
"execution_count": null,
"execution_count": 1,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"hellohellohello\n"
]
}
],
"source": [
"print(\"hello\" * 3)"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 2,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"x = 2, y = 3.000000\n"
]
}
],
"source": [
"print(\"x = %d, y = %f\" % (2, 3.0))"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 3,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"(2-3j)\n"
]
}
],
"source": [
"x = 3 + 2j\n",
"y = -1j\n",
@@ -31,9 +55,26 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 4,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"abcdefg\n",
"bc\n",
"bcdefg\n",
"abc\n",
"abcdef\n",
"ef\n",
"efg\n",
"abcdefg\n",
"aceg\n",
"gfedcba\n"
]
}
],
"source": [
"strs = \"abcdefg\"\n",
"print(strs[0:7:1])\n",
@@ -50,9 +91,17 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"较小值为: 5.4\n"
]
}
],
"source": [
"def minimal(x, y):\n",
" if x > y:\n",