From b40c615212320373787f17f4c795de21eff124f9 Mon Sep 17 00:00:00 2001 From: fangchengyue <49714886+fangchengyue@users.noreply.github.com> Date: Wed, 6 Nov 2019 11:27:46 +0800 Subject: [PATCH 1/5] Home work some change --- exercises/1901010088/1001S02E01_helloworld.txt | 2 ++ exercises/1901010088/1001S02E01_helloworld.txt.txt | 1 - .../1901010088/{README.md.txt => 1001S02E02_hello_python.py} | 0 exercises/1901010088/README.md | 0 4 files changed, 2 insertions(+), 1 deletion(-) create mode 100644 exercises/1901010088/1001S02E01_helloworld.txt delete mode 100644 exercises/1901010088/1001S02E01_helloworld.txt.txt rename exercises/1901010088/{README.md.txt => 1001S02E02_hello_python.py} (100%) create mode 100644 exercises/1901010088/README.md diff --git a/exercises/1901010088/1001S02E01_helloworld.txt b/exercises/1901010088/1001S02E01_helloworld.txt new file mode 100644 index 000000000..c97954c3d --- /dev/null +++ b/exercises/1901010088/1001S02E01_helloworld.txt @@ -0,0 +1,2 @@ +1. It's a nice day ,today! +2.听了笑来老师分享的”长期“概念,再也不是遥遥无期很漫长的感觉。 \ No newline at end of file diff --git a/exercises/1901010088/1001S02E01_helloworld.txt.txt b/exercises/1901010088/1001S02E01_helloworld.txt.txt deleted file mode 100644 index 362d2b055..000000000 --- a/exercises/1901010088/1001S02E01_helloworld.txt.txt +++ /dev/null @@ -1 +0,0 @@ -1. It's a nice day ,today! \ No newline at end of file diff --git a/exercises/1901010088/README.md.txt b/exercises/1901010088/1001S02E02_hello_python.py similarity index 100% rename from exercises/1901010088/README.md.txt rename to exercises/1901010088/1001S02E02_hello_python.py diff --git a/exercises/1901010088/README.md b/exercises/1901010088/README.md new file mode 100644 index 000000000..e69de29bb From 23eedb352ba44f2c44e6517f6445482d56ec3af0 Mon Sep 17 00:00:00 2001 From: fangchengyue <49714886+fangchengyue@users.noreply.github.com> Date: Fri, 8 Nov 2019 11:47:17 +0800 Subject: [PATCH 2/5] Update 1001S02E02_hello_python.py add hello world python --- exercises/1901010088/1001S02E02_hello_python.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/exercises/1901010088/1001S02E02_hello_python.py b/exercises/1901010088/1001S02E02_hello_python.py index e69de29bb..3595daf2b 100644 --- a/exercises/1901010088/1001S02E02_hello_python.py +++ b/exercises/1901010088/1001S02E02_hello_python.py @@ -0,0 +1,4 @@ +msg="Hello World" +print(msg) + +msg.capitalize \ No newline at end of file From de166f3ecb09ffaff35f035ed092a47d819b0d19 Mon Sep 17 00:00:00 2001 From: fangchengyue <49714886+fangchengyue@users.noreply.github.com> Date: Tue, 19 Nov 2019 19:36:11 +0800 Subject: [PATCH 3/5] Create 1001S02E03_calculator.py --- exercises/1901010088/1001S02E03_calculator.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 exercises/1901010088/1001S02E03_calculator.py diff --git a/exercises/1901010088/1001S02E03_calculator.py b/exercises/1901010088/1001S02E03_calculator.py new file mode 100644 index 000000000..e69de29bb From c26a884976330bbbbbc9fb524ee844dd29dbcde9 Mon Sep 17 00:00:00 2001 From: fangchengyue <49714886+fangchengyue@users.noreply.github.com> Date: Tue, 19 Nov 2019 19:38:24 +0800 Subject: [PATCH 4/5] Update 1001S02E03_calculator.py calculator homework --- exercises/1901010088/1001S02E03_calculator.py | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) diff --git a/exercises/1901010088/1001S02E03_calculator.py b/exercises/1901010088/1001S02E03_calculator.py index e69de29bb..ef350e290 100644 --- a/exercises/1901010088/1001S02E03_calculator.py +++ b/exercises/1901010088/1001S02E03_calculator.py @@ -0,0 +1,46 @@ +#定义函数 +def add(x, y): + """相加""" + + return x + y + +def abstract(x. y): + """相减""" + + return x - y + +def multipy(x, y): + """相乘""" + + return x * y + +def divide(x, y): + """相除""" + + return x / y + +# 用户输入 +print("选择运算:") +print("1、相加") +print("2、相减") +print("3、相乘") +print("4、相除") + +choice=input("输入你选择的(1/2/3/4):") + +num1=int(input("输入第一个数字: ")) +num2=int(input("输入第二个数字: ")) + +if choice == "1": + print(num1,"+",num2,"=",add(num1,num2)) + +elif choice == "2": + print(num1,"-",num2,"=",subtract(num1,num2)) + +elif choice == "3": + print(num1,"*",num2,"=",multiple(num1,num2)) + +elif choice =="3": + print(num1,"/",num2,"=",divide(num1,num2)) +else: + print("非法输入") \ No newline at end of file From ae2d2c0fe57d403666be7b2e9c3f500d5aac4bcf Mon Sep 17 00:00:00 2001 From: fangchengyue <49714886+fangchengyue@users.noreply.github.com> Date: Thu, 21 Nov 2019 00:12:03 +0800 Subject: [PATCH 5/5] Create 1001S02E04_control_flow.py Home work Day4 --- .../1901010088/1001S02E04_control_flow.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 exercises/1901010088/1001S02E04_control_flow.py diff --git a/exercises/1901010088/1001S02E04_control_flow.py b/exercises/1901010088/1001S02E04_control_flow.py new file mode 100644 index 000000000..52c20a9b8 --- /dev/null +++ b/exercises/1901010088/1001S02E04_control_flow.py @@ -0,0 +1,24 @@ +print() +print("1. 使用for…in循环打印九九乘法表,输出") + +print() +for i in range(1,10): + for j in range (1,i+1): + print(i,"*",j,"=",i*j,end="\t") + print() + + +print() + +print("2. 使用fwhile循环打印九九乘法表并用条件判断把偶数行删除,输出") +print() +i=1 +while i<10: + if i%2==1: + j=1 + while j<=i: + print('%d * %d = %-2d'%(i,j,i*j),end='\t') + j=j+1 + print() + i=i+1 +