From de0fb5ee4211785456f1ac5980ad49ac3060c511 Mon Sep 17 00:00:00 2001 From: qiwsir Date: Thu, 14 Feb 2019 14:49:00 +0800 Subject: [PATCH 1/5] video lesson code --- videolesson/arithmetic.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 videolesson/arithmetic.py diff --git a/videolesson/arithmetic.py b/videolesson/arithmetic.py new file mode 100644 index 0000000..b7f2ce5 --- /dev/null +++ b/videolesson/arithmetic.py @@ -0,0 +1,22 @@ +#coding:utf-8 + +''' +lesson 07-6 +filename: arithmetic.py +''' + +print('Please input two int:') +a = input('a number:') +b = input('another number:') +a = int(a) +b = int(b) + +add_result = a + b +sub_result = a - b +mul_result = a * b +div_result = a / b + +print(a, " + ", b, ' = ', add_result) +print(a, " - ", b, ' = ', sub_result) +print(a, " * ", b, ' = ', mul_result) +print(a, " / ", b, ' = ', div_result) \ No newline at end of file From de40299eef0e6fae286ea8a16d78f60d5ef61a69 Mon Sep 17 00:00:00 2001 From: qiwsir Date: Sat, 9 Mar 2019 16:03:30 +0800 Subject: [PATCH 2/5] some modified --- README.md | 8 ++------ videolesson/country.py | 12 ++++++++++++ videolesson/judge_input.py | 13 +++++++++++++ videolesson/newton.py | 12 ++++++++++++ videolesson/odd_even.py | 16 ++++++++++++++++ 5 files changed, 55 insertions(+), 6 deletions(-) create mode 100644 videolesson/country.py create mode 100644 videolesson/judge_input.py create mode 100644 videolesson/newton.py create mode 100644 videolesson/odd_even.py diff --git a/README.md b/README.md index 979a993..bb7552f 100755 --- a/README.md +++ b/README.md @@ -18,11 +18,7 @@ 关于本QQ群的更多说明: -- 加入本群,收费1元,目的是免群主审核,并且拦住广告发布人。如果对此有异议,请不要加入。 -- 因为设置了上述功能,群主无法单独邀请用户加入了(这是QQ方面的规定),所以,不要让群主邀请。 -- 更不要通过其它途径给群主一块钱,然后让群主想办法把你加到群里,群主表示做不到。 - -再次提醒:对入群收费1元,有异议者请不要加入。 +- 入群回答问题,答案是:5。 # 本书配套小程序 @@ -33,4 +29,4 @@ # Python学习资源推荐: - 系列图书《跟老齐学Python:Django实战》、《跟老齐学Python:数据分析》,各大网店和书店有售 -- 在线课程:[Python3入门和能力提升](https://www.cctalk.com/m/course/111302) +- 在线视频课程:[Python3入门和提升](https://itdiffer.com/course/47) diff --git a/videolesson/country.py b/videolesson/country.py new file mode 100644 index 0000000..2e11dfc --- /dev/null +++ b/videolesson/country.py @@ -0,0 +1,12 @@ +#coding:utf-8 + +''' +lesson 15-3 +filename: country.py +''' + +country = {"CHINA": "BEIJING", 'CANADA': "OTTAWA", 'GREECE': 'ATHENS', 'ITALY': 'ROME'} + +name = input("input the name of country:") +capital = country[name] +print(name, "-->", capital) \ No newline at end of file diff --git a/videolesson/judge_input.py b/videolesson/judge_input.py new file mode 100644 index 0000000..0c6a52f --- /dev/null +++ b/videolesson/judge_input.py @@ -0,0 +1,13 @@ +#coding:utf-8 +''' + lesson 19-03 + filename: judge_input.py +''' +input_char = input("Input something: ") +if input_char.isdigit(): + result = int(input_char) * 10 + print("You input {0}. Output is {1}".format(input_char, result)) +elif input_char.isalpha(): + print(input_char + "@python") +else: + print(input_char) \ No newline at end of file diff --git a/videolesson/newton.py b/videolesson/newton.py new file mode 100644 index 0000000..a35f0e3 --- /dev/null +++ b/videolesson/newton.py @@ -0,0 +1,12 @@ +#coding: utf-8 +''' + calculate the square root by Newton's method. + lesson 22-1 + filename: newton.py +''' +value = 23 #f(x) = x^2 - 23 +epsilon = 0.001 +result = value / 2 +while abs(result*result - value) >= epsilon: + result = result - ((result*result - value) / (2 * result)) +print("The square root of {0} is about {1}".format(value, result)) \ No newline at end of file diff --git a/videolesson/odd_even.py b/videolesson/odd_even.py new file mode 100644 index 0000000..f2f83f1 --- /dev/null +++ b/videolesson/odd_even.py @@ -0,0 +1,16 @@ +#coding:utf-8 +''' + lesson 19-04 + filename: odd_even.py +''' +lst = [1,2,3,4,5,6,7,8,9,10] +odd = [] +even = [] +for i in lst: + if i % 2 == 0: + even.append(i) + else: + odd.append(i) + +print("odd: ", odd) +print("even: ", even) \ No newline at end of file From f4b974fdd9168e400b2432cca9de31728bbb01ef Mon Sep 17 00:00:00 2001 From: qiwsir Date: Thu, 30 Apr 2020 10:41:20 +0800 Subject: [PATCH 3/5] modify readme --- README.md | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index bb7552f..b9286cf 100755 --- a/README.md +++ b/README.md @@ -8,25 +8,22 @@ # 相关资源 -## 个人网站 - -[itdiffer.com](http://www.itdiffer.com) - -## QQ群:26913719 +## 读者QQ群:26913719 说明:此QQ群是读者交流,而非作者答疑区,请特别注意。如果读者有问题,可以在群里面跟其它读者交流。作者没有答疑的义务。恕不接待任何形式的答疑。 -关于本QQ群的更多说明: - -- 入群回答问题,答案是:5。 +## 微信公众号:老齐教室 -# 本书配套小程序 +![](https://public-tuchuang.oss-cn-hangzhou.aliyuncs.com/officialaccounts_20200311104512.png) -小程序名称:跟老齐学 +## 与本书相关的其他资源: - +- 勘误与修订:https://itdiffer.com/2020/04/30/learn-python-with-laoqi/ +- 推荐相关视频课程: + - CSDN学院:[《Python零基础轻松入门》](https://edu.csdn.net/course/detail/26676) + - 网易云课堂:[《Python全栈工程师》](https://mooc.study.163.com/smartSpec/detail/1202847601.htm) +- 更多文章:[Python编程文章汇总](https://mp.weixin.qq.com/s/zkfCSuyMndWXkUashl3peg) -# Python学习资源推荐: +## 购买地址 -- 系列图书《跟老齐学Python:Django实战》、《跟老齐学Python:数据分析》,各大网店和书店有售 -- 在线视频课程:[Python3入门和提升](https://itdiffer.com/course/47) +各大电商平台有售。 \ No newline at end of file From 44c5e448f40b893aef1fa8de438a313a298d8fc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E9=BD=90?= Date: Thu, 11 Jan 2024 08:30:51 +0800 Subject: [PATCH 4/5] Update README.md --- README.md | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/README.md b/README.md index b9286cf..547f1ac 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ ->In the begning when God created the heavens and the earth. the earth was a formless void and darkness covered the face of the deep, while a wind from God swept over the face of the waters. Then God said,"Let there be light"; and there was light. And God saw that the light was good; and God separated the light from the darkness. (GENESIS 1:1-4) +# 注意:本书已经印刷,请学习者,转到:《Python完全自学教程》中学习,这是一本开源免费的在线读物,地址:https://github.com/qiwsir/PythonBook # 《跟老齐学Python:轻松入门》 @@ -7,23 +7,3 @@ ![](./python-book1.png) # 相关资源 - -## 读者QQ群:26913719 - -说明:此QQ群是读者交流,而非作者答疑区,请特别注意。如果读者有问题,可以在群里面跟其它读者交流。作者没有答疑的义务。恕不接待任何形式的答疑。 - -## 微信公众号:老齐教室 - -![](https://public-tuchuang.oss-cn-hangzhou.aliyuncs.com/officialaccounts_20200311104512.png) - -## 与本书相关的其他资源: - -- 勘误与修订:https://itdiffer.com/2020/04/30/learn-python-with-laoqi/ -- 推荐相关视频课程: - - CSDN学院:[《Python零基础轻松入门》](https://edu.csdn.net/course/detail/26676) - - 网易云课堂:[《Python全栈工程师》](https://mooc.study.163.com/smartSpec/detail/1202847601.htm) -- 更多文章:[Python编程文章汇总](https://mp.weixin.qq.com/s/zkfCSuyMndWXkUashl3peg) - -## 购买地址 - -各大电商平台有售。 \ No newline at end of file From 635e5a974d3fc16bcc43a2b3b12232e1f3fce01d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E9=BD=90?= Date: Thu, 11 Jan 2024 08:31:26 +0800 Subject: [PATCH 5/5] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 547f1ac..ae4e10b 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# 注意:本书已经印刷,请学习者,转到:《Python完全自学教程》中学习,这是一本开源免费的在线读物,地址:https://github.com/qiwsir/PythonBook +# 注意:本书已经停止印刷,请学习者转到:《Python完全自学教程》中学习,这是一本开源免费的在线读物,地址:https://github.com/qiwsir/PythonBook # 《跟老齐学Python:轻松入门》