From 8188f8021b154daf325bcff0671dd4fa0c30de6b Mon Sep 17 00:00:00 2001 From: lionel Date: Thu, 13 Oct 2016 11:18:54 +0800 Subject: [PATCH 1/2] Initial commit --- pyExercise/ex1/app1.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pyExercise/ex1/app1.py b/pyExercise/ex1/app1.py index 9d8b4c6..6ae8b08 100644 --- a/pyExercise/ex1/app1.py +++ b/pyExercise/ex1/app1.py @@ -1 +1,2 @@ print("this is app1 version 0.1") +print("this will switch to version 0.2") From 5d93529c12bd8c400892a3a3be2e5e77d351aa1a Mon Sep 17 00:00:00 2001 From: lionel Date: Tue, 18 Oct 2016 16:07:04 +0800 Subject: [PATCH 2/2] Initial commit Signed-off-by: lionel --- pyExercise/ex1/app1.py | 77 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) diff --git a/pyExercise/ex1/app1.py b/pyExercise/ex1/app1.py index 6ae8b08..f1f6d94 100644 --- a/pyExercise/ex1/app1.py +++ b/pyExercise/ex1/app1.py @@ -1,2 +1,79 @@ print("this is app1 version 0.1") print("this will switch to version 0.2") + +#ex1 +''' +for i in range(1,5): + for j in range(1,5): + for k in range(1,5): + if (i!=j and j!=k and i!=k): + print(i,j,k) +''' + +#ex2 +''' +import math +for i in range(10000): + x=int(math.sqrt(i+100)) + y=int(math.sqrt(i+268)) + if(x*x==i+100 and y*y==i+268): + print("result: %d"%i) + break +''' + +#ex3 +''' +li=[] +for i in range(3): + x=int(input("input integer:")) + li.append(x) +li.sort() +print(li) +''' + +#ex4 +''' +i=input("input number:") +number=int(i) +li=[] +for it in range(0,number+1): + li.append(True) + +li[0]=False +li[1]=False +li[2]=False +for i in range(2,number+1): + j=i + mult=2 + while j