Skip to content

13:04 #1201

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

13:04 #1201

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

特别感谢**霍炬**([@virushuo](https://github.com/virushuo))、**洪强宁**([@hongqn](https://github.com/hongqn)) 两位良师诤友在此书写作过程中给予我的巨大帮助!

Runaway-bot 2025 年 2 月 14 日

```python
# pseudo-code of selfteaching in Python

Expand Down
3 changes: 3 additions & 0 deletions my-notes/new/.idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions my-notes/new/.idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions my-notes/new/.idea/inspectionProfiles/profiles_settings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions my-notes/new/.idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions my-notes/new/.idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions my-notes/new/.idea/new.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions my-notes/new/Hello.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print('(True and False) yields:', True and False)
294 changes: 294 additions & 0 deletions my-notes/new/Part1-E-1.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,294 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"id": "c8ce66d9-f19e-41ed-97a2-8fc6217c98bf",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1\n",
"3\n",
"5\n",
"7\n",
"9\n"
]
}
],
"source": [
"for i in range(10):\n",
" if i % 2 != 0:\n",
" print(i)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"id": "93a65062-eda2-42b6-b185-3a965fb859a1",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2\n",
"3\n",
"5\n",
"7\n",
"11\n",
"13\n",
"17\n",
"19\n",
"23\n",
"29\n",
"31\n",
"37\n",
"41\n",
"43\n",
"47\n",
"53\n",
"59\n",
"61\n",
"67\n",
"71\n",
"73\n",
"79\n",
"83\n",
"89\n",
"97\n"
]
}
],
"source": [
"# 获取100以内的质数\n",
"\n",
"for n in range(2, 100):\n",
" if n == 2:\n",
" print(n)\n",
" continue\n",
" for i in range(2, n):\n",
" if (n % i) == 0:\n",
" break\n",
" else:\n",
" print(n)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"id": "473f1f9d-2148-4d7d-96a8-743802196147",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"2\n",
"3\n",
"5\n",
"7\n",
"11\n",
"13\n",
"17\n",
"19\n",
"23\n",
"29\n",
"31\n",
"37\n",
"41\n",
"43\n",
"47\n",
"53\n",
"59\n",
"61\n",
"67\n",
"71\n",
"73\n",
"79\n",
"83\n",
"89\n",
"97\n"
]
}
],
"source": [
"for n in range(2, 100):\n",
" if n == 2:\n",
" print(n)\n",
" continue\n",
" for i in range(2, int(n ** 0.5)+1):\n",
" if (n % i) == 0:\n",
" break\n",
" else:\n",
" print(n)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"id": "5a5fdc10-d895-44dc-a79e-d726390d1438",
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"3.1415926"
]
},
"execution_count": 5,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"a = abs(-3.1415926)\n",
"a"
]
},
{
"cell_type": "code",
"execution_count": 7,
"id": "3b1a9f45-c511-4989-95dc-0ac1b31ecd14",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"83\n",
"89\n",
"97\n",
"101\n",
"103\n",
"107\n",
"109\n"
]
}
],
"source": [
"def is_prime(n):\n",
" if n < 2:\n",
" return False\n",
" if n == 2:\n",
" return True\n",
" for m in range(2, int(n ** 0.5)+1):\n",
" if (n % m) == 0:\n",
" return False\n",
" else:\n",
" return True\n",
"\n",
"for i in range(80, 110):\n",
" if is_prime(i):\n",
" print(i)"
]
},
{
"cell_type": "code",
"execution_count": 8,
"id": "808654fe-9e56-4663-8d99-9512abdbeb0b",
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"1\n"
]
}
],
"source": [
"x = 0\n",
"x += 1\n",
"print(x)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "852917a5-c9f3-4a40-860c-1b9076d1f0e7",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "32b714dd-993e-4a8e-a5ad-efafd1cbf9ce",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "29119e58-515f-44ea-a086-2d4c72b9b558",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "d4b2d537-3f9b-4306-92ed-234bf1dc1870",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "f0d3417d-7ebe-4982-a9e3-dd4ff039b5ef",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "483fef03-e291-4668-b984-d99d4f70d192",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "f74c48ae-8905-48e1-ad33-184560737020",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "f9867a85-a207-4d60-9d33-489ecb39c294",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.4"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading