From 4fb76f5a26626af8a6ef33f2d3521a6a4ba0424a Mon Sep 17 00:00:00 2001 From: vivian6152 <348915475@qq.com> Date: Mon, 19 Aug 2019 20:36:08 +0800 Subject: [PATCH 1/4] 1 --- exercises/1901100297/1001S02E01_helloworld.txt | 1 + exercises/1901100297/README.md | 0 2 files changed, 1 insertion(+) create mode 100644 exercises/1901100297/1001S02E01_helloworld.txt create mode 100644 exercises/1901100297/README.md diff --git a/exercises/1901100297/1001S02E01_helloworld.txt b/exercises/1901100297/1001S02E01_helloworld.txt new file mode 100644 index 000000000..23c83a622 --- /dev/null +++ b/exercises/1901100297/1001S02E01_helloworld.txt @@ -0,0 +1 @@ +balababal \ No newline at end of file diff --git a/exercises/1901100297/README.md b/exercises/1901100297/README.md new file mode 100644 index 000000000..e69de29bb From e9f0ba16c2b4e23999eb43e48fc6951c0769cf77 Mon Sep 17 00:00:00 2001 From: vivian6152 <348915475@qq.com> Date: Tue, 20 Aug 2019 16:27:41 +0800 Subject: [PATCH 2/4] Create 1001S02E02_hello_python.py --- exercises/1901100297/1001S02E02_hello_python.py | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 exercises/1901100297/1001S02E02_hello_python.py diff --git a/exercises/1901100297/1001S02E02_hello_python.py b/exercises/1901100297/1001S02E02_hello_python.py new file mode 100644 index 000000000..7593920e0 --- /dev/null +++ b/exercises/1901100297/1001S02E02_hello_python.py @@ -0,0 +1,2 @@ +msg = "Hello World" +print(msg) \ No newline at end of file From b42805caf90e63afb95788b7824d3e1a3dcc9ca3 Mon Sep 17 00:00:00 2001 From: vivian6152 <348915475@qq.com> Date: Thu, 22 Aug 2019 16:29:31 +0800 Subject: [PATCH 3/4] Create 1001S02E03_calculator.py --- exercises/1901100297/1001S02E03_calculator.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 exercises/1901100297/1001S02E03_calculator.py diff --git a/exercises/1901100297/1001S02E03_calculator.py b/exercises/1901100297/1001S02E03_calculator.py new file mode 100644 index 000000000..22eba2c37 --- /dev/null +++ b/exercises/1901100297/1001S02E03_calculator.py @@ -0,0 +1,11 @@ +def add(x,y): + print(x+y) + +def minus(x,y): + print(x-y) + +def multiply(x,y): + print(x*y) + +def divide(x,y): + print(x/y) From d1bcbb84b24ff95b9f311b226dfa97112cc9547f Mon Sep 17 00:00:00 2001 From: vivian6152 <348915475@qq.com> Date: Thu, 22 Aug 2019 21:01:01 +0800 Subject: [PATCH 4/4] Update 1001S02E03_calculator.py --- exercises/1901100297/1001S02E03_calculator.py | 48 +++++++++++++++---- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/exercises/1901100297/1001S02E03_calculator.py b/exercises/1901100297/1001S02E03_calculator.py index 22eba2c37..c1808bfbe 100644 --- a/exercises/1901100297/1001S02E03_calculator.py +++ b/exercises/1901100297/1001S02E03_calculator.py @@ -1,11 +1,43 @@ -def add(x,y): - print(x+y) +print('我们来做四则运算,请选择你的运算类型') +print('1,加法') +print('2,减法') +print('3,乘法') +print('4,除法') -def minus(x,y): - print(x-y) +choice = input("选择运算类型(1/2/3/4)") -def multiply(x,y): - print(x*y) +if choice =='1': + print("第一个数") + a=input() + x=int(a) + print('第二个数') + b=input() + y=int(b) + print("结果",x+y) -def divide(x,y): - print(x/y) +elif choice =='2': + print("第一个数") + a=input() + x=int(a) + print('第二个数') + b=input() + y=int(b) + print("结果",x-y) + +elif choice =='3': + print("第一个数") + a=input() + x=int(a) + print('第二个数') + b=input() + y=int(b) + print("结果",x*y) + +elif choice =='4': + print("第一个数") + a=input() + x=int(a) + print('第二个数') + b=input() + y=int(b) + print("结果",x/y)