From 2ebf795a44ea71b3974d5c6ee9f043da5abd5748 Mon Sep 17 00:00:00 2001 From: leruyi <534702657@qq.com> Date: Wed, 23 Oct 2019 18:58:21 +0800 Subject: [PATCH 1/8] 190100102 day1 --- 190100102/1001S02E01-helloworld.txt | 0 190100102/README.md | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 190100102/1001S02E01-helloworld.txt create mode 100644 190100102/README.md diff --git a/190100102/1001S02E01-helloworld.txt b/190100102/1001S02E01-helloworld.txt new file mode 100644 index 000000000..e69de29bb diff --git a/190100102/README.md b/190100102/README.md new file mode 100644 index 000000000..e69de29bb From 02cbea40e0e793ff344034ed25e764cf52e5ef78 Mon Sep 17 00:00:00 2001 From: leruyi <534702657@qq.com> Date: Thu, 31 Oct 2019 11:18:42 +0800 Subject: [PATCH 2/8] =?UTF-8?q?191100102=E8=87=AA=E5=AD=A6=E8=AE=AD?= =?UTF-8?q?=E7=BB=83=E8=90=A516=E6=9C=9Fday2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 190100102/1001S02E02_hello_python.py.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 190100102/1001S02E02_hello_python.py.txt diff --git a/190100102/1001S02E02_hello_python.py.txt b/190100102/1001S02E02_hello_python.py.txt new file mode 100644 index 000000000..e69de29bb From c493fb5088dc6442549adfa2fb1ee5a82be36fbd Mon Sep 17 00:00:00 2001 From: leruyi <534702657@qq.com> Date: Thu, 31 Oct 2019 11:30:59 +0800 Subject: [PATCH 3/8] =?UTF-8?q?1901100102=E8=87=AA=E5=AD=A6=E8=AE=AD?= =?UTF-8?q?=E7=BB=83=E8=90=A5=E7=AC=AC16=E6=9C=9Fday2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 190100102/1001SO2E01_hello_python.py.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 190100102/1001SO2E01_hello_python.py.txt diff --git a/190100102/1001SO2E01_hello_python.py.txt b/190100102/1001SO2E01_hello_python.py.txt new file mode 100644 index 000000000..e69de29bb From 6ef449b3b3810f1ddc5e68181d355d1a6ddba255 Mon Sep 17 00:00:00 2001 From: leruyi <534702657@qq.com> Date: Thu, 31 Oct 2019 14:38:20 +0800 Subject: [PATCH 4/8] =?UTF-8?q?1901100102=20=E8=87=AA=E5=AD=A6=E8=AE=AD?= =?UTF-8?q?=E7=BB=83=E8=90=A516=E6=9C=9Fday2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 190100102/1001S02E02_hello_python.py | 1 + 1 file changed, 1 insertion(+) create mode 100644 190100102/1001S02E02_hello_python.py diff --git a/190100102/1001S02E02_hello_python.py b/190100102/1001S02E02_hello_python.py new file mode 100644 index 000000000..00950d9ac --- /dev/null +++ b/190100102/1001S02E02_hello_python.py @@ -0,0 +1 @@ +print('hello world') \ No newline at end of file From 6a47a8f65687426b0eea798c7e8172db927c6f7e Mon Sep 17 00:00:00 2001 From: leruyi <534702657@qq.com> Date: Thu, 31 Oct 2019 15:08:53 +0800 Subject: [PATCH 5/8] Delete 1001SO2E01_hello_python.py.txt --- 190100102/1001SO2E01_hello_python.py.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 190100102/1001SO2E01_hello_python.py.txt diff --git a/190100102/1001SO2E01_hello_python.py.txt b/190100102/1001SO2E01_hello_python.py.txt deleted file mode 100644 index e69de29bb..000000000 From bf6eeeda58ea7ed4f2b00204ccdbe2cd561ea6fd Mon Sep 17 00:00:00 2001 From: leruyi <534702657@qq.com> Date: Tue, 5 Nov 2019 14:19:34 +0800 Subject: [PATCH 6/8] =?UTF-8?q?1901100102=E8=87=AA=E5=AD=A6=E8=AE=AD?= =?UTF-8?q?=E7=BB=83=E8=90=A516=E6=9C=9F=E4=BD=9C=E4=B8=9Aday=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1901100102/1001S02E03_calculator.py | 43 +++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 1901100102/1001S02E03_calculator.py diff --git a/1901100102/1001S02E03_calculator.py b/1901100102/1001S02E03_calculator.py new file mode 100644 index 000000000..4da1b46b3 --- /dev/null +++ b/1901100102/1001S02E03_calculator.py @@ -0,0 +1,43 @@ + +# 这是单行注释 + +''' +这是 +多行注释 +注释的作用只是方便我们理解代码,并不参与执行 +''' + +""" +这也是 +多行注释 +""" + +# 计算器确定输入三个值,分别是运算值,运算符左边的数字和运算符右边的数字 + +# 把内置函数 input 接收的 输入字符 赋值 给 变量 +operator = input('请输入运算符(+、-、*、/):')# input 里面的字符串的作用是在等待输入的时候进行提示 +first_number = input('请输入第一个数字:') +second_number = input('请输入第二个数字:') + +a = int(first_number) # int(first_number) 在这里的作用是 把 str 类型 的 first_number 转换成 int 类型 +b = int(second_number) + +print('operator:',operator,type(operator) ) +print('firsr_number:',first_number,type(first_number),type(a)) +print('second_number:',second_number,type(second_number),type(b)) + +print('测试加法 str 加法:',first_number + second_number) +# print(测试加法 str 减法:', first_number - second_number) + + +if operator == '+': + print(a, '+', b, '=', a + b) +elif operator == '-': + print(a, '-', b, '=', a - b) +elif operator == '*': + print(a, '*', b, '=', a * b) +elif operator == '/': + print(a, '/', b, '=', a / b) +else: + print('无效的运算符') + # raise ValueError('无效的运算符') From bfbb28227f926e93f9c23857207b32acd29f31d1 Mon Sep 17 00:00:00 2001 From: leruyi <534702657@qq.com> Date: Tue, 5 Nov 2019 15:30:24 +0800 Subject: [PATCH 7/8] =?UTF-8?q?1901100102=E8=87=AA=E5=AD=A6=E8=AE=AD?= =?UTF-8?q?=E7=BB=83=E8=90=A516=E6=9C=9Fday=203?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 190100102/1001S02E01-helloworld.txt | 0 190100102/1001S02E02_hello_python.py.txt | 0 {190100102 => 1901100102}/1001S02E02_hello_python.py | 0 {190100102 => 1901100102}/README.md | 0 4 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 190100102/1001S02E01-helloworld.txt delete mode 100644 190100102/1001S02E02_hello_python.py.txt rename {190100102 => 1901100102}/1001S02E02_hello_python.py (100%) rename {190100102 => 1901100102}/README.md (100%) diff --git a/190100102/1001S02E01-helloworld.txt b/190100102/1001S02E01-helloworld.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/190100102/1001S02E02_hello_python.py.txt b/190100102/1001S02E02_hello_python.py.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/190100102/1001S02E02_hello_python.py b/1901100102/1001S02E02_hello_python.py similarity index 100% rename from 190100102/1001S02E02_hello_python.py rename to 1901100102/1001S02E02_hello_python.py diff --git a/190100102/README.md b/1901100102/README.md similarity index 100% rename from 190100102/README.md rename to 1901100102/README.md From 89eaebca16386694699ffd544e1c4062ebb4da32 Mon Sep 17 00:00:00 2001 From: leruyi <534702657@qq.com> Date: Mon, 25 Nov 2019 18:39:22 +0800 Subject: [PATCH 8/8] =?UTF-8?q?1901100102=E8=87=AA=E5=AD=A6=E8=AE=AD?= =?UTF-8?q?=E7=BB=83=E8=90=A5=E7=AC=AC16=E6=9C=9Fday=204?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 1001S2E04_control_flow.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 1001S2E04_control_flow.py diff --git a/1001S2E04_control_flow.py b/1001S2E04_control_flow.py new file mode 100644 index 000000000..b7abcebc4 --- /dev/null +++ b/1001S2E04_control_flow.py @@ -0,0 +1,19 @@ + +print('打印九九乘法表') +for i in range(1,10): + # print('第%d行' % i, end='\t') + for j in range(1, i + 1): + print(i, '*', j, '=', i * j, end='\t') + #print('{} * {} = {}'.format(i, j, i * j), end='\t') + print() + + print('\n打印跳过偶数行的九九乘法表') + i = 1 + while i < 10: + if i % 2== 0: + print() + else: + for j in range(1, i + 1): + print(i, '*', j, '=', i * j, end='\t') + # print('{} * {} = {}'.format(i, j, i * j), end='\t') + i += 1 \ No newline at end of file